Death from any cause or requirement of new intensive respiratory support (invasive or non-invasive ventilation) or vasopressor/inotropic support in the 28 days after randomisation.
This document reports on the analysis of the primary outcome for ASCOT.
Author
James Totterdell
Published
July 26, 2023
Primary Outcome Definition
The primary outcome is a composite of death, need for new respiratory support, or vasopressor/inotropic support. From the protocol:
Death from any cause or requirement of new intensive respiratory support (invasive or non-invasive ventilation) or vasopressor/inotropic support in the 28 days after randomisation. This includes any participant who receives non-invasive mechanical ventilation (either CPAP or BIPAP, apart from the below considerations) any time after enrolment even if not transferred to ICU. It does NOT include the use of humidified high-flow nasal prong oxygen.
Participants on pre-existing home BiPAP or CPAP will not be considered to have met the primary outcome unless they have either:
required invasive mechanical ventilation (i.e. intubation), or
graduated from CPAP only whilst asleep to BiPAP at any time, or
graduated from BiPAP only whilst asleep to BiPAP for >12 hours/day, or
died by day 28
There may be cases where a patient has been assessed as requiring intensive respiratory support (invasive or non-invasive ventilation) or vasopressor/inotropic support, but the patient or family declined treatment and the patient was discharged home. If attempts to obtain 28-day data are unsuccessful or not possible, and the investigator had deemed at the time of discharge that the patient would be highly likely to die within 28 days from randomisation, these participants will be deemed to have met the primary outcome.
Derivation of the Outcome
Derivation of the outcome requires checking of the daily, discharge, and day 28 data extracts. On the daily data, there is a variable DD_PrimaryEndpointReachedToday however this was coded incorrectly in the original database and therefore fails to capture some participants. Additionally, given the composite nature of the outcome it is useful to check all components individually as well as the composite outcome. Therefore, this variable is not used in the derivation, but is included as a cross-check.
Below, each component is summarised in aggregate for the FAS-ITT set.
Day 28 mortality
Antiviral
Anticoagulation
Outcome
Breakdown
A0
A1
A2
C0
C1
C2
C3
C4
Overall
Mortality
Alive at day 28
1364 (95.2)
73 (100.0)
82 (100.0)
32 (100.0)
579 (94.9)
593 (96.7)
271 (95.8)
44 (88.0)
1519 (95.7)
Death within 28 days
Total
50 (3.5)
0 (0.0)
0 (0.0)
0 (0.0)
19 (3.1)
15 (2.4)
10 (3.5)
6 (12.0)
50 (3.1)
Death within 28 days
Prior to discharge
40 (2.8)
0 (0.0)
0 (0.0)
0 (0.0)
15 (2.5)
11 (1.8)
10 (3.5)
4 (8.0)
40 (2.5)
Death within 28 days
Post-discharge
10 (0.7)
0 (0.0)
0 (0.0)
0 (0.0)
4 (0.7)
4 (0.7)
0 (0.0)
2 (4.0)
10 (0.6)
Unknown
19 (1.3)
0 (0.0)
0 (0.0)
0 (0.0)
12 (2.0)
5 (0.8)
2 (0.7)
0 (0.0)
19 (1.2)
Total
1433 (100.0)
73 (100.0)
82 (100.0)
32 (100.0)
610 (100.0)
613 (100.0)
283 (100.0)
50 (100.0)
1588 (100.0)
Table 1: 28-day mortality by domain intervention and overall.
Vasopressor/inotropic requirement
Antiviral
Anticoagulation
Outcome
Breakdown
A0
A1
A2
C0
C1
C2
C3
C4
Overall
Vasopressor/inotropes
Not required
1391 (97.1)
71 (97.3)
81 (98.8)
31 (96.9)
592 (97.0)
599 (97.7)
273 (96.5)
48 (96.0)
1543 (97.2)
Use within 28 days
Total
18 (1.3)
2 (2.7)
1 (1.2)
1 (3.1)
6 (1.0)
6 (1.0)
6 (2.1)
2 (4.0)
21 (1.3)
Use within 28 days
Prior to discharge
17 (1.2)
2 (2.7)
1 (1.2)
1 (3.1)
5 (0.8)
6 (1.0)
6 (2.1)
2 (4.0)
20 (1.3)
Use within 28 days
Post-discharge
3 (0.2)
0 (0.0)
0 (0.0)
0 (0.0)
2 (0.3)
0 (0.0)
0 (0.0)
1 (2.0)
3 (0.2)
Unknown
24 (1.7)
0 (0.0)
0 (0.0)
0 (0.0)
12 (2.0)
8 (1.3)
4 (1.4)
0 (0.0)
24 (1.5)
Total
1433 (100.0)
73 (100.0)
82 (100.0)
32 (100.0)
610 (100.0)
613 (100.0)
283 (100.0)
50 (100.0)
1588 (100.0)
Table 2: 28-day vasopressor/inotrope use by domain intervention and overall.
New intensive respiratory support
Antiviral
Anticoagulation
Outcome
Breakdown
A0
A1
A2
C0
C1
C2
C3
C4
Overall
Ventilation
Not required
1339 (93.4)
65 (89.0)
78 (95.1)
28 (87.5)
564 (92.5)
584 (95.3)
263 (92.9)
43 (86.0)
1482 (93.3)
Use within 28 days
Total
76 (5.3)
8 (11.0)
4 (4.9)
4 (12.5)
35 (5.7)
24 (3.9)
18 (6.4)
7 (14.0)
88 (5.5)
Use within 28 days
Prior to discharge
58 (4.0)
8 (11.0)
4 (4.9)
4 (12.5)
29 (4.8)
19 (3.1)
13 (4.6)
5 (10.0)
70 (4.4)
Use within 28 days
Post-discharge
18 (1.3)
0 (0.0)
0 (0.0)
0 (0.0)
6 (1.0)
5 (0.8)
5 (1.8)
2 (4.0)
18 (1.1)
Unknown
18 (1.3)
0 (0.0)
0 (0.0)
0 (0.0)
11 (1.8)
5 (0.8)
2 (0.7)
0 (0.0)
18 (1.1)
Total
1433 (100.0)
73 (100.0)
82 (100.0)
32 (100.0)
610 (100.0)
613 (100.0)
283 (100.0)
50 (100.0)
1588 (100.0)
Table 3: 28-day new intensive respiratory support by domain intervention and overall.
Table 5: Composite primary endpoint breakdown for anticoagulation domain.
Antiviral
Outcome
Breakdown
Not randomised
to antiviral
(n = 1433)
Standard
of care
(n = 73)
Nafamostat
(n = 82)
Overall
(n = 1588)
Primary outcome
No
1331 (92.9)
65 (89.0)
78 (95.1)
1474 (92.8)
Yes
79 (5.5)
8 (11.0)
4 (4.9)
91 (5.7)
Unknown
Total
23 (1.6)
0 (0.0)
0 (0.0)
23 (1.4)
Unknown
Day 28 status
18 (1.3)
0 (0.0)
0 (0.0)
18 (1.1)
Unknown
Vasopressor/inotropes
5 (0.3)
0 (0.0)
0 (0.0)
5 (0.3)
Total
1433 (100.0)
73 (100.0)
82 (100.0)
1588 (100.0)
Mortality
Alive at day 28
1364 (95.2)
73 (100.0)
82 (100.0)
1519 (95.7)
Death within 28 days
Total
50 (3.5)
0 (0.0)
0 (0.0)
50 (3.1)
Death within 28 days
Prior to discharge
40 (2.8)
0 (0.0)
0 (0.0)
40 (2.5)
Death within 28 days
Post-discharge
10 (0.7)
0 (0.0)
0 (0.0)
10 (0.6)
Unknown
19 (1.3)
0 (0.0)
0 (0.0)
19 (1.2)
Total
1433 (100.0)
73 (100.0)
82 (100.0)
1588 (100.0)
Vasopressor/inotropes
Not required
1391 (97.1)
71 (97.3)
81 (98.8)
1543 (97.2)
Use within 28 days
Total
18 (1.3)
2 (2.7)
1 (1.2)
21 (1.3)
Use within 28 days
Prior to discharge
17 (1.2)
2 (2.7)
1 (1.2)
20 (1.3)
Use within 28 days
Post-discharge
3 (0.2)
0 (0.0)
0 (0.0)
3 (0.2)
Unknown
24 (1.7)
0 (0.0)
0 (0.0)
24 (1.5)
Total
1433 (100.0)
73 (100.0)
82 (100.0)
1588 (100.0)
Ventilation
Not required
1339 (93.4)
65 (89.0)
78 (95.1)
1482 (93.3)
Use within 28 days
Total
76 (5.3)
8 (11.0)
4 (4.9)
88 (5.5)
Use within 28 days
Prior to discharge
58 (4.0)
8 (11.0)
4 (4.9)
70 (4.4)
Use within 28 days
Post-discharge
18 (1.3)
0 (0.0)
0 (0.0)
18 (1.1)
Unknown
18 (1.3)
0 (0.0)
0 (0.0)
18 (1.1)
Total
1433 (100.0)
73 (100.0)
82 (100.0)
1588 (100.0)
Table 6: Composite primary endpoint breakdown for antiviral domain.
Summarise Primary Outcome
n (\%)
Low
dose
Intermediate
dose
Low dose
with aspirin
Therapeutic
dose
Overall
Randomised
610
613
283
50
1556
Outcome missing
12 (2.0)
7 (1.1)
4 (1.4)
0 (0.0)
23 (1.5)
Outcome observed
598 (98.0)
606 (98.9)
279 (98.6)
50 (100.0)
1533 (98.5)
Met primary outcome
35 (5.9)
25 (4.1)
20 (7.2)
7 (14.0)
87 (5.7)
Table 7: Primary outcome by anti-coagulation intervention.
n (\%)
Standard
of care
Nafamostat
Overall
Randomised
73
82
155
Outcome missing
0 (0.0)
0 (0.0)
0 (0.0)
Outcome observed
73 (100.0)
82 (100.0)
155 (100.0)
Met primary outcome
8 (11.0)
4 (4.9)
12 (7.7)
Table 8: Primary outcome by anti-viral intervention.
Descriptive Analyses
By Interim Analysis
Outcome
\makecell[c]{Not\\randomised C}
Low
Intermediate
\makecell[c]{Low with\\aspirin}
Therapeutic
Overall (n = 1588)
Randomised
32
610
613
283
50
Known
32 (100)
598 (98)
606 (99)
279 (99)
50 (100)
Met primary outcome
4 (12)
35 (6)
25 (4)
20 (7)
7 (14)
Death
0 (0)
19 (3)
15 (2)
10 (4)
6 (12)
Vasopressor/inotropic support
1 (3)
6 (1)
6 (1)
6 (2)
2 (4)
Intensive respiratory support
4 (12)
35 (6)
24 (4)
18 (6)
7 (14)
Interim 1 (n = 685)
Randomised
-
234
226
225
-
Known
-
227 (97)
222 (98)
222 (99)
-
Met primary outcome
-
22 (10)
15 (7)
19 (9)
-
Death
-
13 (6)
11 (5)
9 (4)
-
Vasopressor/inotropic support
-
2 (1)
3 (1)
6 (3)
-
Intensive respiratory support
-
22 (10)
15 (7)
17 (8)
-
Interim 2 (n = 259)
Randomised
13
90
98
58
-
Known
13 (100)
90 (100)
98 (100)
57 (98)
-
Met primary outcome
0 (0)
2 (2)
3 (3)
1 (2)
-
Death
0 (0)
1 (1)
3 (3)
1 (2)
-
Vasopressor/inotropic support
0 (0)
1 (1)
0 (0)
0 (0)
-
Intensive respiratory support
0 (0)
2 (2)
3 (3)
1 (2)
-
Interim 3 (n = 392)
Randomised
8
177
172
-
35
Known
8 (100)
175 (99)
171 (99)
-
35 (100)
Met primary outcome
3 (38)
8 (5)
4 (2)
-
6 (17)
Death
0 (0)
4 (2)
0 (0)
-
5 (14)
Vasopressor/inotropic support
0 (0)
3 (2)
2 (1)
-
2 (6)
Intensive respiratory support
3 (38)
8 (5)
4 (2)
-
6 (17)
Interim 4 (n = 237)
Randomised
3
108
112
-
14
Known
3 (100)
105 (97)
111 (99)
-
14 (100)
Met primary outcome
1 (33)
3 (3)
3 (3)
-
1 (7)
Death
0 (0)
1 (1)
1 (1)
-
1 (7)
Vasopressor/inotropic support
1 (33)
0 (0)
1 (1)
-
0 (0)
Intensive respiratory support
1 (33)
3 (3)
2 (2)
-
1 (7)
Interim 5 (n = 15)
Randomised
8
1
5
-
1
Known
8 (100)
1 (100)
4 (80)
-
1 (100)
Met primary outcome
0 (0)
0 (0)
0 (0)
-
0 (0)
Death
0 (0)
0 (0)
0 (0)
-
0 (0)
Vasopressor/inotropic support
0 (0)
0 (0)
0 (0)
-
0 (0)
Intensive respiratory support
0 (0)
0 (0)
0 (0)
-
0 (0)
Outcome
\makecell[c]{Not\\randomised A}
SoC
Nafamostat
Overall (n = 1588)
Randomised
1433
73
82
Known
1410 (98)
73 (100)
82 (100)
Met primary outcome
79 (6)
8 (11)
4 (5)
Death
50 (4)
0 (0)
0 (0)
Vasopressor/inotropic support
18 (1)
2 (3)
1 (1)
Intensive respiratory support
76 (5)
8 (11)
4 (5)
Interim 1 (n = 685)
Randomised
683
-
2
Known
669 (98)
-
2 (100)
Met primary outcome
56 (8)
-
0 (0)
Death
33 (5)
-
0 (0)
Vasopressor/inotropic support
11 (2)
-
0 (0)
Intensive respiratory support
54 (8)
-
0 (0)
Interim 2 (n = 259)
Randomised
202
31
26
Known
201 (100)
31 (100)
26 (100)
Met primary outcome
6 (3)
0 (0)
0 (0)
Death
5 (2)
0 (0)
0 (0)
Vasopressor/inotropic support
1 (0)
0 (0)
0 (0)
Intensive respiratory support
6 (3)
0 (0)
0 (0)
Interim 3 (n = 392)
Randomised
326
29
37
Known
323 (99)
29 (100)
37 (100)
Met primary outcome
12 (4)
7 (24)
2 (5)
Death
9 (3)
0 (0)
0 (0)
Vasopressor/inotropic support
5 (2)
2 (7)
0 (0)
Intensive respiratory support
12 (4)
7 (24)
2 (5)
Interim 4 (n = 237)
Randomised
220
6
11
Known
216 (98)
6 (100)
11 (100)
Met primary outcome
5 (2)
1 (17)
2 (18)
Death
3 (1)
0 (0)
0 (0)
Vasopressor/inotropic support
1 (0)
0 (0)
1 (9)
Intensive respiratory support
4 (2)
1 (17)
2 (18)
Interim 5 (n = 15)
Randomised
2
7
6
Known
1 (50)
7 (100)
6 (100)
Met primary outcome
0 (0)
0 (0)
0 (0)
Death
0 (0)
0 (0)
0 (0)
Vasopressor/inotropic support
0 (0)
0 (0)
0 (0)
Intensive respiratory support
0 (0)
0 (0)
0 (0)
Domain A
Domain C
Outcome
\makecell[c]{Not\\randomised A}
SoC
Nafamostat
\makecell[c]{Not\\randomised C}
Low
Intermediate
\makecell[c]{Low with\\aspirin}
Therapeutic
Overall (n = 1588)
Randomised
1433
73
82
32
610
613
283
50
Known
1410 (98)
73 (100)
82 (100)
32 (100)
598 (98)
606 (99)
279 (99)
50 (100)
Met primary outcome
79 (6)
8 (11)
4 (5)
4 (12)
35 (6)
25 (4)
20 (7)
7 (14)
Death
50 (4)
0 (0)
0 (0)
0 (0)
19 (3)
15 (2)
10 (4)
6 (12)
Vasopressor/inotropic support
18 (1)
2 (3)
1 (1)
1 (3)
6 (1)
6 (1)
6 (2)
2 (4)
Intensive respiratory support
76 (5)
8 (11)
4 (5)
4 (12)
35 (6)
24 (4)
18 (6)
7 (14)
Interim 1 (n = 685)
Randomised
683
-
2
-
234
226
225
-
Known
669 (98)
-
2 (100)
-
227 (97)
222 (98)
222 (99)
-
Met primary outcome
56 (8)
-
0 (0)
-
22 (10)
15 (7)
19 (9)
-
Death
33 (5)
-
0 (0)
-
13 (6)
11 (5)
9 (4)
-
Vasopressor/inotropic support
11 (2)
-
0 (0)
-
2 (1)
3 (1)
6 (3)
-
Intensive respiratory support
54 (8)
-
0 (0)
-
22 (10)
15 (7)
17 (8)
-
Interim 2 (n = 259)
Randomised
202
31
26
13
90
98
58
-
Known
201 (100)
31 (100)
26 (100)
13 (100)
90 (100)
98 (100)
57 (98)
-
Met primary outcome
6 (3)
0 (0)
0 (0)
0 (0)
2 (2)
3 (3)
1 (2)
-
Death
5 (2)
0 (0)
0 (0)
0 (0)
1 (1)
3 (3)
1 (2)
-
Vasopressor/inotropic support
1 (0)
0 (0)
0 (0)
0 (0)
1 (1)
0 (0)
0 (0)
-
Intensive respiratory support
6 (3)
0 (0)
0 (0)
0 (0)
2 (2)
3 (3)
1 (2)
-
Interim 3 (n = 392)
Randomised
326
29
37
8
177
172
-
35
Known
323 (99)
29 (100)
37 (100)
8 (100)
175 (99)
171 (99)
-
35 (100)
Met primary outcome
12 (4)
7 (24)
2 (5)
3 (38)
8 (5)
4 (2)
-
6 (17)
Death
9 (3)
0 (0)
0 (0)
0 (0)
4 (2)
0 (0)
-
5 (14)
Vasopressor/inotropic support
5 (2)
2 (7)
0 (0)
0 (0)
3 (2)
2 (1)
-
2 (6)
Intensive respiratory support
12 (4)
7 (24)
2 (5)
3 (38)
8 (5)
4 (2)
-
6 (17)
Interim 4 (n = 237)
Randomised
220
6
11
3
108
112
-
14
Known
216 (98)
6 (100)
11 (100)
3 (100)
105 (97)
111 (99)
-
14 (100)
Met primary outcome
5 (2)
1 (17)
2 (18)
1 (33)
3 (3)
3 (3)
-
1 (7)
Death
3 (1)
0 (0)
0 (0)
0 (0)
1 (1)
1 (1)
-
1 (7)
Vasopressor/inotropic support
1 (0)
0 (0)
1 (9)
1 (33)
0 (0)
1 (1)
-
0 (0)
Intensive respiratory support
4 (2)
1 (17)
2 (18)
1 (33)
3 (3)
2 (2)
-
1 (7)
Interim 5 (n = 15)
Randomised
2
7
6
8
1
5
-
1
Known
1 (50)
7 (100)
6 (100)
8 (100)
1 (100)
4 (80)
-
1 (100)
Met primary outcome
0 (0)
0 (0)
0 (0)
0 (0)
0 (0)
0 (0)
-
0 (0)
Death
0 (0)
0 (0)
0 (0)
0 (0)
0 (0)
0 (0)
-
0 (0)
Vasopressor/inotropic support
0 (0)
0 (0)
0 (0)
0 (0)
0 (0)
0 (0)
-
0 (0)
Intensive respiratory support
0 (0)
0 (0)
0 (0)
0 (0)
0 (0)
0 (0)
-
0 (0)
Intervention
The following presents the primary outcome rate by antiviral intervention
Figure 1: Primary outcome by assigned antiviral (AVS-ITT).
Age
The following presents the primary outcome rate by age in years.
Figure 2: Relationship (logistic regression linear in age) between age at entry and the primary outcome.
Sex
Figure 3: Primary outcome by sex
Oxygen requirement
Figure 4: Primary outcome by supplemental oxygen
?(caption)
Oxygen requirement
Total
No
Yes
Unknown
No
917
872 (97)
31 (3)
14 (3)
Yes
646
577 (91)
60 (9)
9 (9)
(Missing)
25
25 (100)
0 (0)
0 (0)
Country
The following presents the primary outcome rate by country.
Figure 5: Primary outcome by country.
Figure 6: Primary outcome by country.
Site
The following presents the primary outcome rate by study site.
Figure 7: Primary outcome by site within country.
Figure 8: Primary outcome by site within country.
Calendar Time
Figure 9: Relationship between calendar date and the primary outcome.
There was interest in investigating a cut-point of calendar time due to changes in the predominant circulating variant. A proposed cut-point was 2021-12-20.
Figure 10: Relationship between calendar date and the primary outcome by cut-point, FAS-ITT.
Figure 11: Relationship between calendar date and the primary outcome by cut-point, AVS-ITT.
Baseline CRP
Baseline CRP
Total
No
Yes
Unknown
[3,41]
47
45 (96)
2 (4)
0 (4)
(41,81]
46
39 (85)
7 (15)
0 (15)
(81,467]
46
43 (93)
3 (7)
0 (7)
(Missing)
16
16 (100)
0 (0)
0 (0)
Table 9: Relationship between CRP and primary outcome, AVS-ITT.
Days since symptom onset
Figure 12: Relationship (logistic regression linear) between days since symptom onset at entry and the primary outcome.
MLE Estimates
As a point of reference, treatment only logistic regression models are estimated using maximum likelihood for each of the 3 analysis sets. These are obviously inappropriate given the design, but provide some reference values.
FAS-ITT
effect
group
term
estimate
std.error
statistic
p.value
conf.low
conf.high
fixed
NA
(Intercept)
0.03
0.03
-3.78
0.00
0.00
0.18
fixed
NA
facAA0
0.74
0.66
-0.34
0.73
0.13
4.26
fixed
NA
facAA2
0.39
0.26
-1.43
0.15
0.11
1.42
fixed
NA
facCC0
1.95
1.39
0.94
0.35
0.48
7.89
fixed
NA
facCC2
0.75
0.20
-1.07
0.28
0.44
1.27
fixed
NA
facCC3
0.97
0.31
-0.09
0.92
0.52
1.82
fixed
NA
facCC4
2.68
1.45
1.83
0.07
0.93
7.72
fixed
NA
inelgc3
1.76
0.95
1.04
0.30
0.61
5.07
fixed
NA
agegte60
1.85
0.43
2.65
0.01
1.17
2.90
fixed
NA
supp_oxy2
2.78
0.67
4.27
0.00
1.74
4.45
fixed
NA
ctryAU/NZ
1.64
1.29
0.63
0.53
0.35
7.64
fixed
NA
ctryNP
2.05
1.04
1.42
0.16
0.76
5.52
ran_pars
epoch
sd__(Intercept)
0.70
NA
NA
NA
NA
NA
Table 10: Maximum likelihood odds ratio estimates for FAS-ITT set.
ACS-ITT
effect
group
term
estimate
std.error
statistic
p.value
conf.low
conf.high
fixed
NA
(Intercept)
0.06
0.07
-2.42
0.02
0.01
0.58
fixed
NA
facAA0
0.33
0.37
-0.98
0.33
0.04
3.02
fixed
NA
facAA2
0.20
0.17
-1.90
0.06
0.04
1.05
fixed
NA
facCC2
0.74
0.20
-1.10
0.27
0.43
1.27
fixed
NA
facCC3
1.00
0.32
-0.01
0.99
0.53
1.87
fixed
NA
facCC4
2.95
1.64
1.94
0.05
0.99
8.79
fixed
NA
inelgc3
2.01
1.10
1.27
0.20
0.69
5.89
fixed
NA
agegte60
1.90
0.45
2.71
0.01
1.19
3.01
fixed
NA
supp_oxy2
2.97
0.72
4.45
0.00
1.84
4.79
fixed
NA
ctryAU/NZ
0.93
0.97
-0.07
0.94
0.12
7.26
fixed
NA
ctryNP
2.17
1.13
1.49
0.14
0.78
6.02
ran_pars
epoch
sd__(Intercept)
0.68
NA
NA
NA
NA
NA
Table 11: Maximum likelihood odds ratio estimates for ACS-ITT set.
AVS-ITT
term
estimate
std.error
statistic
p.value
conf.low
conf.high
(Intercept)
0.03
1.03
-3.29
0.00
0.00
0.16
facAA2
0.37
0.64
-1.53
0.13
0.10
1.26
supp_oxy2
4.96
1.07
1.50
0.13
0.91
92.60
Table 12: Maximum likelihood odds ratio estimates for AVS-ITT set.
Analyses
The SAP specified the primary analyses as using the AVS-ITT set with terms for:
all treatments (including ineligibilities and not-randomised terms)
region
site
epoch
age
sex
oxygen requirement
C-reactive protein.
This was to be repeated for FAS-ITT.
Some general notes:
there were concerns with the accuracy of C-reactive protein values reported in India (incorrect units reported, unrealistic values), therefore CRP is treated as unknown for Indian participants (most participants). Therefore, CRP is included for models using AVS-ITT but excluded for models using FAS-ITT.
all interventions in AVS-ITT were concurrently randomised. Therefore, epoch is excluded from the AVS-ITT model.
due to insufficient data, there are concerns that too many model parameters are included when restricting to AVS-ITT. The model parameters will be largely driven by the pre-specified priors for many of the adjustment variables. Therefore, an antiviral-treatment only model was also investigated
to assess prior sensitivity analyses are repeated with diffuse and sceptical priors on treatment variances, and assuming treatment coding on the effect terms rather than orthonormal coding.
FAS-ITT
Pre-specified prior
Using FAS-ITT (excluding participants with missing primary outcome) and the pre-specified primary model (excluding baseline CRP) the conditional odds ratio for Nafamostat versus standard of care was [median (95% CrI), Pr(OR<1)] 0.36 (0.10, 1.26), 0.95.
Parameter
Median
95% CrI
Mean (SD)
Pr(OR < 1)
Nafamostat
0.36
(0.10, 1.26)
0.44 (0.31)
0.95
Intermediate-dose
0.70
(0.41, 1.22)
0.73 (0.21)
0.90
Low-dose with aspirin
0.85
(0.46, 1.57)
0.89 (0.29)
0.69
Therapeutic-dose
2.60
(0.92, 7.15)
2.97 (1.64)
0.04
Ineligible aspirin
2.28
(0.61, 7.39)
2.73 (1.82)
0.10
Age ≥ 60
1.73
(1.06, 2.79)
1.79 (0.45)
0.01
Female
0.64
(0.38, 1.03)
0.65 (0.16)
0.97
Oxygen requirement
3.67
(2.22, 6.19)
3.80 (1.01)
0.00
Australia/New Zealand
1.01
(0.25, 3.94)
1.29 (1.10)
0.49
Nepal
1.60
(0.41, 5.55)
1.96 (1.41)
0.24
Posterior summaries for model parameters.
Intervention
Posterior
Superior Pr(OR = min(OR))
Effective Pr(OR < 1)
Futile Pr(OR > 1/1.1)
Equivalent Pr(1/1.1 < OR < 1.1)
Antiviral
SoC
1.00
0.05
-
-
-
Nafamostat
0.36 (0.10, 1.26)
0.95
0.95
0.07
0.03
Anticoagulation
Low-dose
1.00
0.06
-
-
-
Intermediate-dose
0.70 (0.41, 1.22)
0.67
0.90
0.18
0.13
Low-dose with aspirin
0.85 (0.46, 1.57)
0.26
0.69
0.42
0.21
Therapeutic-dose
2.60 (0.92, 7.15)
0.01
0.04
0.98
0.03
Table 13: Decision quantity summaries, FAS-ITT.
Figure 13: Posterior densities for odds ratio contrasts.
In this model, we investigate Nafamostat as the only fixed covariate, but still include site (not nested within region) and epoch as random effects.
Parameter
Median
95% CrI
Mean (SD)
Pr(OR < 1)
Nafamostat
0.37
(0.10, 1.23)
0.45 (0.30)
0.95
Intermediate-dose
0.74
(0.43, 1.27)
0.77 (0.22)
0.86
Low-dose with aspirin
0.84
(0.46, 1.54)
0.88 (0.28)
0.71
Therapeutic-dose
2.54
(0.88, 6.77)
2.87 (1.57)
0.04
Posterior summaries for model parameters.
Treatment coding prior
The primary model is re-fit assuming a prior specified on the treatment indicator variables rather than on the orthonormal terms. Note that the prior scales need to be adjusted. The prior \(\text{Normal}(0,1)\) on the orthonormal terms imply \(\text{Normal}(0,2)\) on the pair-wise differences. Therefore, for the treatment coding we specify a prior standard deviation of \(\sqrt{2}\) instead of 1.
Parameter
Median
95% CrI
Mean (SD)
Pr(OR < 1)
Nafamostat
0.36
(0.10, 1.21)
0.44 (0.31)
0.95
Intermediate-dose
0.66
(0.38, 1.15)
0.69 (0.20)
0.93
Low-dose with aspirin
0.80
(0.42, 1.50)
0.84 (0.28)
0.76
Therapeutic-dose
2.63
(0.89, 7.37)
3.02 (1.73)
0.04
Ineligible aspirin
2.23
(0.59, 7.21)
2.67 (1.79)
0.11
Age ≥ 60
1.74
(1.07, 2.81)
1.79 (0.45)
0.01
Female
0.63
(0.38, 1.02)
0.65 (0.17)
0.97
Oxygen requirement
3.69
(2.22, 6.24)
3.82 (1.03)
0.00
Australia/New Zealand
1.09
(0.25, 4.52)
1.41 (1.18)
0.45
Nepal
1.55
(0.39, 5.46)
1.90 (1.41)
0.26
Posterior summaries for model parameters.
Diffuse prior
For all fixed model parameters (including treatment differences), assume \(\text{Normal}(0, 10^2)\).
Parameter
Median
95% CrI
Mean (SD)
Pr(OR < 1)
Nafamostat
0.26
(0.05, 1.09)
0.34 (0.28)
0.97
Intermediate-dose
0.69
(0.38, 1.22)
0.72 (0.22)
0.89
Low-dose with aspirin
0.80
(0.41, 1.54)
0.85 (0.29)
0.75
Therapeutic-dose
3.30
(1.00, 10.34)
3.91 (2.55)
0.03
Ineligible aspirin
2.25
(0.59, 7.54)
2.70 (1.85)
0.11
Age ≥ 60
1.78
(1.08, 2.94)
1.84 (0.47)
0.01
Female
0.62
(0.37, 1.02)
0.64 (0.17)
0.97
Oxygen requirement
3.82
(2.27, 6.55)
3.97 (1.10)
0.00
Australia/New Zealand
1.85
(0.12, 25.59)
4.70 (13.95)
0.32
Nepal
3.19
(0.36, 40.93)
9.62 (89.15)
0.14
Posterior summaries for model parameters.
Sceptical prior
For treatment differences, assume \(\text{Normal}(0, 0.4^2)\)
Parameter
Median
95% CrI
Mean (SD)
Pr(OR < 1)
Nafamostat
0.74
(0.38, 1.46)
0.79 (0.28)
0.80
Intermediate-dose
0.79
(0.50, 1.24)
0.81 (0.19)
0.84
Low-dose with aspirin
0.94
(0.57, 1.53)
0.97 (0.25)
0.60
Therapeutic-dose
1.25
(0.67, 2.31)
1.31 (0.42)
0.24
Ineligible aspirin
2.37
(0.64, 7.44)
2.81 (1.85)
0.09
Age ≥ 60
1.75
(1.09, 2.80)
1.80 (0.44)
0.01
Female
0.67
(0.40, 1.07)
0.68 (0.17)
0.95
Oxygen requirement
3.59
(2.14, 6.04)
3.72 (1.00)
0.00
Australia/New Zealand
1.07
(0.29, 3.67)
1.30 (0.90)
0.46
Nepal
1.81
(0.45, 6.19)
2.20 (1.58)
0.18
Posterior summaries for model parameters.
Best Case
Parameter
Median
95% CrI
Mean (SD)
Pr(OR < 1)
Nafamostat
0.36
(0.10, 1.23)
0.44 (0.31)
0.95
Intermediate-dose
0.71
(0.41, 1.22)
0.74 (0.21)
0.89
Low-dose with aspirin
0.86
(0.46, 1.58)
0.90 (0.29)
0.69
Therapeutic-dose
2.65
(0.91, 7.40)
3.03 (1.71)
0.04
Ineligible aspirin
2.55
(0.68, 7.95)
3.01 (1.95)
0.08
Age ≥ 60
1.73
(1.07, 2.81)
1.78 (0.45)
0.01
Female
0.64
(0.39, 1.04)
0.66 (0.17)
0.96
Oxygen requirement
3.67
(2.23, 6.19)
3.81 (1.01)
0.00
Australia/New Zealand
0.97
(0.24, 3.84)
1.24 (0.96)
0.52
Nepal
1.62
(0.41, 5.65)
1.98 (1.43)
0.24
Posterior summaries for model parameters.
Figure 14: Posterior densities for odds ratio contrasts.
Worst Case
Parameter
Median
95% CrI
Mean (SD)
Pr(OR < 1)
Nafamostat
0.40
(0.11, 1.32)
0.48 (0.33)
0.93
Intermediate-dose
0.67
(0.41, 1.09)
0.69 (0.18)
0.95
Low-dose with aspirin
0.76
(0.42, 1.32)
0.79 (0.23)
0.83
Therapeutic-dose
1.74
(0.64, 4.51)
1.96 (1.02)
0.13
Ineligible aspirin
1.14
(0.31, 3.61)
1.35 (0.87)
0.42
Age ≥ 60
1.61
(1.04, 2.50)
1.65 (0.37)
0.02
Female
0.79
(0.52, 1.21)
0.81 (0.18)
0.86
Oxygen requirement
2.88
(1.83, 4.50)
2.95 (0.70)
0.00
Australia/New Zealand
2.01
(0.48, 7.63)
2.51 (1.90)
0.16
Nepal
1.48
(0.37, 5.24)
1.82 (1.39)
0.28
Posterior summaries for model parameters.
Figure 15: Posterior densities for odds ratio contrasts.
Australia/New Zealand Only
dropped region covariate
dropped ineligibility for aspirin covariate (4 cases)
Parameter
Median
95% CrI
Mean (SD)
Pr(OR < 1)
Nafamostat
0.39
(0.10, 1.37)
0.48 (0.35)
0.93
Intermediate-dose
1.00
(0.24, 4.18)
1.31 (1.11)
0.50
Low-dose with aspirin
1.03
(0.11, 8.90)
1.87 (2.85)
0.49
Therapeutic-dose
1.09
(0.17, 6.55)
1.65 (1.94)
0.46
Age ≥ 60
1.30
(0.29, 5.28)
1.67 (1.39)
0.36
Female
0.67
(0.16, 2.41)
0.82 (0.61)
0.73
Oxygen requirement
1.88
(0.44, 10.02)
2.71 (3.08)
0.21
Posterior summaries for model parameters.
Figure 16: Posterior densities for odds ratio contrasts.
Country instead of region
Parameter
Median
95% CrI
Mean (SD)
Pr(OR < 1)
Nafamostat
0.34
(0.09, 1.19)
0.42 (0.30)
0.95
Intermediate-dose
0.71
(0.40, 1.24)
0.74 (0.21)
0.89
Low-dose with aspirin
0.85
(0.44, 1.60)
0.89 (0.30)
0.69
Therapeutic-dose
2.57
(0.89, 7.05)
2.93 (1.63)
0.04
Ineligible aspirin
2.30
(0.62, 7.40)
2.74 (1.82)
0.10
Age ≥ 60
1.72
(1.05, 2.78)
1.77 (0.45)
0.02
Female
0.65
(0.39, 1.05)
0.67 (0.17)
0.96
Oxygen requirement
3.71
(2.23, 6.23)
3.84 (1.03)
0.00
Australia
0.75
(0.19, 2.85)
0.94 (0.72)
0.67
Nepal
1.51
(0.40, 5.20)
1.84 (1.33)
0.26
New Zealand
1.77
(0.29, 7.94)
2.36 (2.10)
0.26
Posterior summaries for model parameters.
Intervention
Posterior
Superior Pr(OR = min(OR))
Effective Pr(OR < 1)
Futile Pr(OR > 1/1.1)
Equivalent Pr(1/1.1 < OR < 1.1)
Antiviral
SoC
1.00
0.05
-
-
-
Nafamostat
0.34 (0.09, 1.19)
0.95
0.95
0.06
0.03
Anticoagulation
Low-dose
1.00
0.07
-
-
-
Intermediate-dose
0.71 (0.40, 1.24)
0.66
0.89
0.19
0.13
Low-dose with aspirin
0.85 (0.44, 1.60)
0.27
0.69
0.42
0.21
Therapeutic-dose
2.57 (0.89, 7.05)
0.01
0.04
0.97
0.03
Table 14: Decision quantity summaries, FAS-ITT.
Figure 17: Posterior densities for odds ratio contrasts.
ACS-ITT
Pre-specified
Parameter
Median
95% CrI
Mean (SD)
Pr(OR < 1)
Nafamostat
0.24
(0.05, 1.02)
0.32 (0.28)
0.97
Intermediate-dose
0.70
(0.40, 1.20)
0.73 (0.21)
0.90
Low-dose with aspirin
0.85
(0.44, 1.59)
0.89 (0.30)
0.70
Therapeutic-dose
2.57
(0.88, 7.22)
2.95 (1.70)
0.04
Ineligible aspirin
2.54
(0.65, 8.60)
3.09 (2.16)
0.08
Age ≥ 60
1.76
(1.08, 2.89)
1.82 (0.47)
0.01
Female
0.64
(0.38, 1.05)
0.66 (0.17)
0.96
Oxygen requirement
3.77
(2.25, 6.43)
3.92 (1.08)
0.00
Australia/New Zealand
0.83
(0.18, 3.41)
1.08 (0.90)
0.60
Nepal
1.73
(0.44, 6.19)
2.13 (1.60)
0.21
Posterior summaries for model parameters.
Intervention
Posterior
Superior Pr(OR = min(OR))
Effective Pr(OR < 1)
Futile Pr(OR > 1/1.1)
Equivalent Pr(1/1.1 < OR < 1.1)
Antiviral
SoC
1.00
0.03
-
-
-
Nafamostat
0.24 (0.05, 1.02)
0.97
0.97
0.04
0.02
Anticoagulation
Low-dose
1.00
0.06
-
-
-
Intermediate-dose
0.70 (0.40, 1.20)
0.67
0.90
0.18
0.12
Low-dose with aspirin
0.85 (0.44, 1.59)
0.26
0.70
0.42
0.21
Therapeutic-dose
2.57 (0.88, 7.22)
0.01
0.04
0.97
0.03
Table 15: Decision quantity summaries, ACS-ITT.
Figure 18: Posterior densities for odds ratio contrasts.
Diffuse
Parameter
Median
95% CrI
Mean (SD)
Pr(OR < 1)
Nafamostat
0.26
(0.05, 1.09)
0.34 (0.28)
0.97
Intermediate-dose
0.69
(0.38, 1.22)
0.72 (0.22)
0.89
Low-dose with aspirin
0.80
(0.41, 1.54)
0.85 (0.29)
0.75
Therapeutic-dose
3.30
(1.00, 10.34)
3.91 (2.55)
0.03
Ineligible aspirin
2.25
(0.59, 7.54)
2.70 (1.85)
0.11
Age ≥ 60
1.78
(1.08, 2.94)
1.84 (0.47)
0.01
Female
0.62
(0.37, 1.02)
0.64 (0.17)
0.97
Oxygen requirement
3.82
(2.27, 6.55)
3.97 (1.10)
0.00
Australia/New Zealand
1.85
(0.12, 25.59)
4.70 (13.95)
0.32
Nepal
3.19
(0.36, 40.93)
9.62 (89.15)
0.14
Posterior summaries for model parameters.
AVS-ITT
Treatment Only
The SAP suggests that the primary analysis be based on the AVS-ITT set, but that adjustment should still be made for all the covariates. This is somewhat problematic as there is no longer sufficient data to inform all of the covariates (e.g. little information available on the effect of anticoagulation interventions, country, age etc.). The following analysis is restricted to the AVS-ITT set but restricts the analysis to a reduced set:
antiviral intervention
anticoagulation intervention
age group
oxygen requirement
Parameter
Median
95% CrI
Mean (SD)
Pr(OR < 1)
Nafamostat
0.48
(0.15, 1.42)
0.56 (0.34)
0.91
Posterior summaries for model parameters.
Figure 19: Posterior densities for odds ratio contrasts.
Pre-specified - without site
In this section the pre-specified model with covariates is fit. However, again with no region, epoch or site specific terms.
Parameter
Median
95% CrI
Mean (SD)
Pr(OR < 1)
Nafamostat
0.40
(0.12, 1.34)
0.48 (0.32)
0.93
Intermediate-dose
0.61
(0.14, 2.51)
0.79 (0.64)
0.76
Low-dose with aspirin
0.52
(0.07, 3.44)
0.83 (0.98)
0.75
Therapeutic-dose
0.83
(0.13, 4.60)
1.22 (1.26)
0.58
Age ≥ 60
1.21
(0.30, 4.44)
1.51 (1.14)
0.39
Female
0.65
(0.16, 2.30)
0.79 (0.58)
0.75
Required oxygen
2.67
(0.59, 16.97)
4.16 (5.52)
0.11
CRP (2nd tertile)
3.15
(0.74, 15.08)
4.36 (4.25)
0.06
CRP (3rd tertile)
0.85
(0.14, 4.75)
1.25 (1.39)
0.58
CRP (unknown)
0.18
(0.00, 2.77)
0.48 (1.11)
0.88
Posterior summaries for model parameters.
Intervention
Posterior
Superior Pr(OR = min(OR))
Effective Pr(OR < 1)
Futile Pr(OR > 1/1.1)
Equivalent Pr(1/1.1 < OR < 1.1)
Antiviral
SoC
1.00
0.07
-
-
-
Nafamostat
0.40 (0.12, 1.34)
0.93
0.93
0.09
0.04
Table 16: Decision quantity summaries, AVS-ITT.
Figure 20: Posterior densities for odds ratio contrasts.
Pre-specified - with site
In this section the pre-specified model with covariates is fit. Again with no epoch terms, but we do include region and site.
Parameter
Median
95% CrI
Mean (SD)
Pr(OR < 1)
Nafamostat
0.36
(0.09, 1.28)
0.44 (0.32)
0.94
Intermediate-dose
0.62
(0.13, 2.84)
0.84 (0.79)
0.73
Low-dose with aspirin
0.67
(0.08, 5.28)
1.16 (1.72)
0.65
Therapeutic-dose
0.78
(0.12, 4.67)
1.19 (1.36)
0.61
Age ≥ 60
1.24
(0.27, 5.01)
1.60 (1.34)
0.39
Female
0.61
(0.13, 2.38)
0.78 (0.62)
0.75
Required oxygen
2.85
(0.57, 19.79)
4.68 (8.46)
0.10
CRP (2nd tertile)
2.90
(0.58, 15.39)
4.18 (4.60)
0.10
CRP (3rd tertile)
0.85
(0.13, 5.07)
1.30 (1.57)
0.57
CRP (unknown)
0.18
(0.00, 3.83)
0.61 (1.85)
0.85
Nepal
0.80
(0.12, 5.16)
1.25 (1.52)
0.60
Posterior summaries for model parameters.
Intervention
Posterior
Superior Pr(OR = min(OR))
Effective Pr(OR < 1)
Futile Pr(OR > 1/1.1)
Equivalent Pr(1/1.1 < OR < 1.1)
Antiviral
SoC
1.00
0.06
-
-
-
Nafamostat
0.36 (0.09, 1.28)
0.94
0.94
0.08
0.03
Table 17: Decision quantity summaries, AVS-ITT.
Figure 21: Posterior densities for odds ratio contrasts.
Treatment coding
Diffuse prior
Parameter
Median
95% CrI
Mean (SD)
Pr(OR < 1)
Nafamostat
0.30
(0.07, 1.14)
0.38 (0.30)
0.96
Age ≥ 60
1.11
(0.25, 4.36)
1.41 (1.12)
0.44
Female
0.65
(0.14, 2.52)
0.82 (0.64)
0.73
Required oxygen
5.30
(0.75, 120.03)
29.42 (432.34)
0.05
CRP (2nd tertile)
4.10
(0.79, 33.57)
7.23 (11.86)
0.05
CRP (3rd tertile)
1.16
(0.16, 10.48)
2.20 (3.91)
0.44
CRP (unknown)
0.00
(0.00, 2.36)
0.28 (1.73)
0.94
Posterior summaries for model parameters, AVS-ITT.
Sceptical prior
Parameter
Median
95% CrI
Mean (SD)
Pr(OR < 1)
Nafamostat
0.62
(0.27, 1.42)
0.68 (0.30)
0.87
Age ≥ 60
1.15
(0.29, 4.00)
1.40 (1.01)
0.42
Female
0.70
(0.18, 2.38)
0.85 (0.60)
0.71
Required oxygen
2.47
(0.56, 16.85)
3.99 (5.85)
0.12
CRP (2nd tertile)
3.06
(0.71, 14.54)
4.20 (4.10)
0.07
CRP (3rd tertile)
1.03
(0.18, 5.69)
1.51 (1.66)
0.48
CRP (unknown)
0.18
(0.00, 3.11)
0.51 (0.96)
0.86
Posterior summaries for model parameters, AVS-ITT.
FAS-PP
Here the primary model is fit to the FAS-PP where per-protocol participants were identified as per the provided listings. Participants may be excluded due to failing the per-protocol criteria for the anticoagulation domain or the antiviral domain (or both).
n (\%)
Not randomised
to anticoagulation
Low
dose
Intermediate
dose
Low dose
with aspirin
Therapeutic
dose
Overall
Randomised
26
595
596
274
44
1535
Outcome missing
0 (0.0)
12 (2.0)
7 (1.2)
3 (1.1)
0 (0.0)
22 (1.4)
Outcome observed
26 (100.0)
583 (98.0)
589 (98.8)
271 (98.9)
44 (100.0)
1513 (98.6)
Met primary outcome
2 (7.7)
35 (6.0)
25 (4.2)
19 (7.0)
6 (13.6)
87 (5.8)
Table 18: Primary outcome by anti-coagulation intervention.
n (\%)
Not randomised
to antiviral
Standard
of care
Nafamostat
Overall
Randomised
1409
67
59
1535
Outcome missing
22 (1.6)
0 (0.0)
0 (0.0)
22 (1.4)
Outcome observed
1387 (98.4)
67 (100.0)
59 (100.0)
1513 (98.6)
Met primary outcome
78 (5.6)
8 (11.9)
1 (1.7)
87 (5.8)
Table 19: Primary outcome by anti-viral intervention.
Parameter
Median
95% CrI
Mean (SD)
Pr(OR < 1)
Nafamostat
0.15
(0.03, 0.64)
0.20 (0.17)
1.00
Intermediate-dose
0.71
(0.40, 1.23)
0.74 (0.22)
0.89
Low-dose with aspirin
0.81
(0.43, 1.53)
0.85 (0.28)
0.74
Therapeutic-dose
2.56
(0.82, 7.32)
2.94 (1.73)
0.05
Ineligible aspirin
2.27
(0.61, 7.54)
2.73 (1.84)
0.10
Age ≥ 60
1.72
(1.04, 2.83)
1.78 (0.46)
0.02
Female
0.57
(0.33, 0.95)
0.59 (0.16)
0.98
Oxygen requirement
3.84
(2.28, 6.53)
3.98 (1.10)
0.00
Australia/New Zealand
0.94
(0.22, 3.73)
1.20 (0.95)
0.53
Nepal
1.62
(0.39, 5.86)
2.00 (1.48)
0.24
Posterior summaries for model parameters.
Figure 22: Posterior densities for odds ratio contrasts.
ACS-PP
Note that for ACS-PP only participants who were not per-protocol according to the anticoagulation domain are excluded. A participant who was not per-protocol according to the antiviral domain but was per-protocol according to the anticoagulation domain is kept in the analysis set. The alternative would be to exclude both (as for FAS-PP).
Parameter
Median
95% CrI
Mean (SD)
Pr(OR < 1)
Nafamostat
0.21
(0.04, 0.89)
0.27 (0.24)
0.98
Intermediate-dose
0.69
(0.39, 1.20)
0.72 (0.21)
0.91
Low-dose with aspirin
0.82
(0.43, 1.53)
0.86 (0.29)
0.73
Therapeutic-dose
3.01
(1.01, 8.82)
3.50 (2.06)
0.02
Ineligible aspirin
2.52
(0.63, 8.33)
3.03 (2.05)
0.09
Age ≥ 60
1.76
(1.07, 2.86)
1.81 (0.46)
0.01
Female
0.61
(0.36, 1.01)
0.63 (0.17)
0.97
Oxygen requirement
3.79
(2.28, 6.44)
3.94 (1.08)
0.00
Australia/New Zealand
0.87
(0.19, 3.57)
1.13 (0.95)
0.57
Nepal
1.62
(0.40, 5.88)
2.00 (1.48)
0.24
Posterior summaries for model parameters.
Figure 23: Posterior densities for odds ratio contrasts.
AVS-PP
Note that for AVS-PP only participants who were not per-protocol according to the antiviral domain are excluded. A participant was not per-protocol according to the anticoagulation domain but was per-protocol according to the antiviral domain is kept in the analysis set. The alternative would be to exclude both (as for FAS-PP).
n (\%)
Not randomised
to anticoagulation
Low
dose
Intermediate
dose
Low dose
with aspirin
Therapeutic
dose
Overall
Randomised
28
43
44
7
13
135
Outcome missing
0 (0.0)
0 (0.0)
0 (0.0)
0 (0.0)
0 (0.0)
0 (0.0)
Outcome observed
28 (100.0)
43 (100.0)
44 (100.0)
7 (100.0)
13 (100.0)
135 (100.0)
Met primary outcome
2 (7.1)
4 (9.3)
3 (6.8)
0 (0.0)
0 (0.0)
9 (6.7)
Table 20: Primary outcome by anti-coagulation intervention, AVS-PP.
n (\%)
Standard
of care
Nafamostat
Overall
Randomised
72
63
135
Outcome missing
0 (0.0)
0 (0.0)
0 (0.0)
Outcome observed
72 (100.0)
63 (100.0)
135 (100.0)
Met primary outcome
8 (11.1)
1 (1.6)
9 (6.7)
Table 21: Primary outcome by anti-viral intervention.
Pre-specified
In this section the pre-specified model with covariates is fit. However, again with no region, epoch or site specific terms.
Parameter
Median
95% CrI
Mean (SD)
Pr(OR < 1)
Nafamostat
0.15
(0.03, 0.63)
0.19 (0.17)
0.99
Intermediate-dose
0.85
(0.15, 4.59)
1.24 (1.35)
0.57
Low-dose with aspirin
0.60
(0.06, 5.38)
1.13 (1.81)
0.67
Therapeutic-dose
0.52
(0.06, 4.01)
0.89 (1.20)
0.73
Age ≥ 60
0.98
(0.17, 4.99)
1.38 (1.43)
0.51
Female
0.22
(0.03, 1.23)
0.33 (0.34)
0.96
Required oxygen
7.26
(1.04, 78.50)
15.31 (32.30)
0.02
CRP (2nd tertile)
1.19
(0.17, 7.74)
1.86 (2.26)
0.43
CRP (3rd tertile)
0.83
(0.12, 5.47)
1.32 (1.63)
0.58
CRP (unknown)
0.21
(0.00, 4.90)
0.74 (1.88)
0.82
Nepal
0.81
(0.12, 5.20)
1.27 (1.54)
0.59
Posterior summaries for model parameters.
Intervention
Posterior
Superior Pr(OR = min(OR))
Effective Pr(OR < 1)
Futile Pr(OR > 1/1.1)
Equivalent Pr(1/1.1 < OR < 1.1)
Antiviral
SoC
1.00
0.01
-
-
-
Nafamostat
0.15 (0.03, 0.63)
0.99
0.99
0.01
0.00
Table 22: Decision quantity summaries, AVS-PP.
Figure 24: Posterior densities for odds ratio contrasts.
Treatment Only
Parameter
Median
95% CrI
Mean (SD)
Pr(OR < 1)
Nafamostat
0.25
(0.05, 0.91)
0.31 (0.24)
0.98
Posterior summaries for model parameters.
Figure 25: Posterior densities for odds ratio contrasts.
Treatment coding
Sceptical
Parameter
Median
95% CrI
Mean (SD)
Pr(OR < 1)
Nafamostat
0.47
(0.19, 1.14)
0.52 (0.25)
0.95
Intermediate-dose
0.92
(0.35, 2.42)
1.04 (0.54)
0.57
Low-dose with aspirin
0.89
(0.31, 2.51)
1.02 (0.59)
0.59
Therapeutic-dose
0.83
(0.30, 2.27)
0.94 (0.53)
0.65
Age ≥ 60
1.07
(0.19, 5.21)
1.48 (1.47)
0.47
Female
0.29
(0.04, 1.46)
0.41 (0.40)
0.93
Required oxygen
6.55
(0.95, 71.10)
13.78 (32.04)
0.03
CRP (2nd tertile)
1.13
(0.19, 7.00)
1.74 (2.08)
0.45
CRP (3rd tertile)
0.89
(0.14, 5.50)
1.38 (1.68)
0.55
CRP (unknown)
0.17
(0.00, 3.31)
0.55 (1.47)
0.87
Nepal
0.82
(0.13, 5.19)
1.28 (1.55)
0.58
Posterior summaries for model parameters.
Intervention
Posterior
Superior Pr(OR = min(OR))
Effective Pr(OR < 1)
Futile Pr(OR > 1/1.1)
Equivalent Pr(1/1.1 < OR < 1.1)
Antiviral
SoC
1.00
0.05
-
-
-
Nafamostat
0.47 (0.19, 1.14)
0.95
0.95
0.07
0.04
Table 23: Decision quantity summaries, AVS-PP.
Figure 26: Posterior densities for odds ratio contrasts.
Concurrent
Source Code
---title: Primary Outcomesubtitle: | Death from any cause or requirement of new intensive respiratory support (invasive or non-invasive ventilation) or vasopressor/inotropic support in the 28 days after randomisation.description: | *This document reports on the analysis of the primary outcome for ASCOT.*author: "James Totterdell"date: todayexecute: echo: false message: false warning: false---```{r}#| label: pkgs#| code-summary: Load packageslibrary(ASCOTr)library(tidyverse)library(lubridate)library(kableExtra)library(patchwork)library(cmdstanr)library(posterior)library(bayesplot)library(ggdist)library(lme4)library(broom)library(broom.mixed)library(bayestestR)library(ggh4x)theme_set(theme_classic(base_size =10, base_family ="Palatino") +theme(panel.grid =element_blank(),strip.background =element_blank()))bayesplot_theme_set(theme_set(theme_classic(base_size =10, base_family ="Palatino") +theme(panel.grid =element_blank(),strip.background =element_blank())))color_scheme_set("red")options(digits =4)``````{r}#| label: analysis-sets#| code-summary: Prepare datasetsall_data <-readRDS(file.path(ASCOT_DATA, "all_data.rds"))all_daily_data <-readRDS(file.path(ASCOT_DATA, "all_daily_data.rds"))pd <-readRDS(file.path(ASCOT_DATA, "pd.rds"))# FAS-ITTfas_itt_dat <- ASCOTr:::make_fas_itt_set(all_data)fas_itt_nona_dat <- fas_itt_dat |>filter(!is.na(PO))# ACS-ITTacs_itt_dat <- ASCOTr:::make_acs_itt_set(all_data)acs_itt_nona_dat <- acs_itt_dat |>filter(!is.na(PO))# AVS-ITTavs_itt_dat <- ASCOTr:::make_avs_itt_set(all_data)avs_itt_nona_dat <- avs_itt_dat |>filter(!is.na(PO))# FAS-ITT Best Case/Worst casefas_itt_bc_dat <- fas_itt_dat |>mutate(PO =if_else(is.na(PO), 0, PO))fas_itt_wc_dat <- fas_itt_dat |>mutate(PO =if_else(is.na(PO), 1, PO))# FAS AU/NZfas_itt_aunz_dat <- fas_itt_dat |>filter(Country %in%c("AU", "NZ"))fas_itt_aunz_nona_dat <- fas_itt_aunz_dat |>filter(!is.na(PO)) |>select(-ctry, -ctry_num, -site, -site_num) |> ASCOTr:::add_region_site_groups()# FAS-PPfas_pp_dat <- fas_itt_dat |>left_join(pd, by ="StudyPatientID") |>filter(is.na(pd_A) | pd_A ==0, is.na(pd_C) | pd_C ==0)fas_pp_nona_dat <- fas_pp_dat |>filter(!is.na(PO))# ACS-PPacs_pp_dat <- acs_itt_dat |>left_join(pd, by ="StudyPatientID") |>filter(is.na(pd_C) | pd_C ==0)acs_pp_nona_dat <- acs_pp_dat |>filter(!is.na(PO))# AVS-PPavs_pp_dat <- avs_itt_dat |>left_join(pd, by ="StudyPatientID") |>filter(is.na(pd_A) | pd_A ==0)avs_pp_nona_dat <- avs_pp_dat |>filter(!is.na(PO))# Concurrent enrolments for C4acs_itt_concurc4_dat <- acs_itt_dat %>%filter(EL_ProtocolVersion =="5.0")acs_itt_concurc4_nona_dat <- acs_itt_concurc4_dat %>%filter(!is.na(PO))``````{r}#| label: stan-models#| code-summary: Load modelslogistic_mod <-compile_cmdstanr_mod(file.path("binary", "logistic"), dir ="stan")logistic_site_epoch <-compile_cmdstanr_mod(file.path("binary", "logistic_site_epoch"), dir ="stan")logistic_site <-compile_cmdstanr_mod(file.path("binary", "logistic_site"), dir ="stan")```# Primary Outcome DefinitionThe primary outcome is a composite of death, need for new respiratory support, or vasopressor/inotropic support. From the protocol:> Death from any cause or requirement of new intensive respiratory support (invasive or non-invasive ventilation) or vasopressor/inotropic support in the 28 days after randomisation. This includes any participant who receives non-invasive mechanical ventilation (either CPAP or BIPAP, apart from the below considerations) any time after enrolment even if not transferred to ICU. It does NOT include the use of humidified high-flow nasal prong oxygen.>> Participants on pre-existing home BiPAP or CPAP will not be considered to have met the primary outcome unless they have either:>> - required invasive mechanical ventilation (i.e. intubation), or> - graduated from CPAP only whilst asleep to BiPAP at any time, or> - graduated from BiPAP only whilst asleep to BiPAP for \>12 hours/day, or> - died by day 28>> There may be cases where a patient has been assessed as requiring intensive respiratory support (invasive or non-invasive ventilation) or vasopressor/inotropic support, but the patient or family declined treatment and the patient was discharged home. If attempts to obtain 28-day data are unsuccessful or not possible, and the investigator had deemed at the time of discharge that the patient would be highly likely to die within 28 days from randomisation, these participants will be deemed to have met the primary outcome.# Derivation of the OutcomeDerivation of the outcome requires checking of the daily, discharge, and day 28 data extracts. On the daily data, there is a variable `DD_PrimaryEndpointReachedToday` however this was coded incorrectly in the original database and therefore fails to capture some participants. Additionally, given the composite nature of the outcome it is useful to check all components individually as well as the composite outcome. Therefore, this variable is not used in the derivation, but is included as a cross-check.Below, each component is summarised in aggregate for the FAS-ITT set.## Day 28 mortality```{r}#| label: tbl-po-component-death#| code-summary: Summarise the death component#| tbl-cap: 28-day mortality by domain intervention and overall.mort_table_A <- all_data |>filter_fas_itt() |>group_by(AAssignment) |>summarise(`Mortality_Alive at day 28_`=sum(1- D28_death, na.rm =TRUE),`Mortality_Death within 28 days_Total`=sum(D28_death, na.rm =TRUE),`Mortality_Death within 28 days_Prior to discharge`=sum(DIS_death & DIS_day <=28, na.rm =TRUE),`Mortality_Death within 28 days_Post-discharge`=sum(D28_death ==1& DIS_death ==0, na.rm =TRUE),`Mortality_Unknown_`=sum(is.na(D28_death)) ) |>gather(key, Frequency, -AAssignment, factor_key = T) |>spread(AAssignment, Frequency) |>separate(key, into =c("Measure", "Outcome", "Breakdown"), sep ="_")mort_table_A <-bind_rows( mort_table_A,summarise(.data = mort_table_A,across(where(is.numeric), ~sum(.x[c(1, 2, 5)])),"Outcome"="Total","Breakdown"="" ) ) |>mutate(across(4:6, ~sprintf("%i (%.1f)", .x, 100* .x /sum(.x[c(1, 2, 5)]))) )mort_table_C <- all_data |>filter_fas_itt() |>group_by(CAssignment) |>summarise(`Mortality_Alive at day 28_`=sum(1- D28_death, na.rm =TRUE),`Mortality_Death within 28 days_Total`=sum(D28_death, na.rm =TRUE),`Mortality_Death within 28 days_Prior to discharge`=sum(DIS_death & DIS_day <=28, na.rm =TRUE),`Mortality_Death within 28 days_Post-discharge`=sum(D28_death ==1& DIS_death ==0, na.rm =TRUE),`Mortality_Unknown_`=sum(is.na(D28_death)) ) |>gather(key, Frequency, -CAssignment, factor_key = T) |>spread(CAssignment, Frequency) |>separate(key, into =c("Measure", "Outcome", "Breakdown"), sep ="_") |>mutate(Overall = C0 + C1 + C2 + C3 + C4)mort_table_C <-bind_rows( mort_table_C,summarise(.data = mort_table_C,across(where(is.numeric), ~sum(.x[c(1, 2, 5)])),"Outcome"="Total","Breakdown"="" ) ) |>mutate(across(4:9, ~sprintf("%i (%.1f)", .x, 100* .x /sum(.x[c(1, 2, 5)]))) )mort_table <-left_join(mort_table_A, mort_table_C, by =c("Measure", "Outcome", "Breakdown"))kable( mort_table %>%select(-1),caption ="Composite primary endpoint breakdown - mortality.",align ="llrrrrrrrrr") %>%kable_styling("striped", font_size =10) %>%collapse_rows(1, valign ="top", latex_hline ='custom', custom_latex_hline =1) |>pack_rows("Mortality", 1, nrow(mort_table)) |>add_header_above(c(" "=2, "Antiviral"=3, "Anticoagulation"=5, " "=1)) |>row_spec(0, align ="c") |>column_spec(3, border_left =TRUE) |>column_spec(6, border_left =TRUE) |>column_spec(11, border_left =TRUE)```## Vasopressor/inotropic requirement```{r}#| label: tbl-po-component-vasopressor#| code-summary: Summarise the vasopressor/inotropes component#| tbl-cap: 28-day vasopressor/inotrope use by domain intervention and overall.vaso_table_A <- all_data |>filter_fas_itt() |>group_by(AAssignment) |>summarise(`Vasopressor/inotropes_Not required_`=sum(1- ANY_vasop, na.rm =TRUE),`Vasopressor/inotropes_Use within 28 days_Total`=sum(ANY_vasop, na.rm =TRUE),`Vasopressor/inotropes_Use within 28 days_Prior to discharge`=sum(DD_vasop, na.rm =TRUE),`Vasopressor/inotropes_Use within 28 days_Post-discharge`=sum(D28_vasop, na.rm =TRUE),`Vasopressor/inotropes_Unknown_`=sum(is.na(ANY_vasop)) ) |>gather(key, Frequency, -AAssignment, factor_key = T) |>spread(AAssignment, Frequency) |>separate(key, into =c("Measure", "Outcome", "Breakdown"), sep ="_")vaso_table_A <-bind_rows( vaso_table_A,summarise(.data = vaso_table_A,across(where(is.numeric), ~sum(.x[c(1, 2, 5)])),"Outcome"="Total","Breakdown"="" ) ) |>mutate(across(4:6, ~sprintf("%i (%.1f)", .x, 100* .x /sum(.x[c(1, 2, 5)]))) )vaso_table_C <- all_data |>filter_fas_itt() |>group_by(CAssignment) |>summarise(`Vasopressor/inotropes_Not required_`=sum(1- ANY_vasop, na.rm =TRUE),`Vasopressor/inotropes_Use within 28 days_Total`=sum(ANY_vasop, na.rm =TRUE),`Vasopressor/inotropes_Use within 28 days_Prior to discharge`=sum(DD_vasop, na.rm =TRUE),`Vasopressor/inotropes_Use within 28 days_Post-discharge`=sum(D28_vasop, na.rm =TRUE),`Vasopressor/inotropes_Unknown_`=sum(is.na(ANY_vasop)) ) |>gather(key, Frequency, -CAssignment, factor_key = T) |>spread(CAssignment, Frequency) |>separate(key, into =c("Measure", "Outcome", "Breakdown"), sep ="_") |>mutate(Overall = C0 + C1 + C2 + C3 + C4)vaso_table_C <-bind_rows( vaso_table_C,summarise(.data = vaso_table_C,across(where(is.numeric), ~sum(.x[c(1, 2, 5)])),"Outcome"="Total","Breakdown"="" ) ) |>mutate(across(4:9, ~sprintf("%i (%.1f)", .x, 100* .x /sum(.x[c(1, 2, 5)]))) )vaso_table <-left_join(vaso_table_A, vaso_table_C, by =c("Measure", "Outcome", "Breakdown"))kable( vaso_table %>%select(-1),align ="llrrrrrrrrr") %>%kable_styling("striped", font_size =10) %>%collapse_rows(1, valign ="top", latex_hline ='custom', custom_latex_hline =1) |>pack_rows("Vasopressor/inotropes", 1, nrow(mort_table)) |>add_header_above(c(" "=2, "Antiviral"=3, "Anticoagulation"=5, " "=1)) |>row_spec(0, align ="c") |>column_spec(3, border_left =TRUE) |>column_spec(6, border_left =TRUE) |>column_spec(11, border_left =TRUE)```## New intensive respiratory support```{r}#| label: tbl-po-component-respiratory#| code-summary: Summarise the ventilation component#| tbl-cap: 28-day new intensive respiratory support by domain intervention and overall.vent_table_A <- all_data |>filter_fas_itt() |>group_by(AAssignment) |>summarise(`Ventilation_Not required_`=sum(1- ANY_vent, na.rm =TRUE),`Ventilation_Use within 28 days_Total`=sum(ANY_vent, na.rm =TRUE),`Ventilation_Use within 28 days_Prior to discharge`=sum(ANY_DD_vent, na.rm =TRUE),`Ventilation_Use within 28 days_Post-discharge`=sum(ANY_vent & ANY_DD_vent ==0, na.rm =TRUE),`Ventilation_Unknown_`=sum(is.na(ANY_vent)) ) |>gather(key, Frequency, -AAssignment, factor_key = T) |>spread(AAssignment, Frequency) |>separate(key, into =c("Measure", "Outcome", "Breakdown"), sep ="_")vent_table_A <-bind_rows( vent_table_A,summarise(.data = vent_table_A,across(where(is.numeric), ~sum(.x[c(1, 2, 5)])),"Outcome"="Total","Breakdown"="" ) ) |>mutate(across(4:6, ~sprintf("%i (%.1f)", .x, 100* .x /sum(.x[c(1, 2, 5)]))) )vent_table_C <- all_data |>filter_fas_itt() |>group_by(CAssignment) |>summarise(`Ventilation_Not required_`=sum(1- ANY_vent, na.rm =TRUE),`Ventilation_Use within 28 days_Total`=sum(ANY_vent, na.rm =TRUE),`Ventilation_Use within 28 days_Prior to discharge`=sum(ANY_DD_vent, na.rm =TRUE),`Ventilation_Use within 28 days_Post-discharge`=sum(ANY_vent & ANY_DD_vent ==0, na.rm =TRUE),`Ventilation_Unknown_`=sum(is.na(ANY_vent)) ) |>gather(key, Frequency, -CAssignment, factor_key = T) |>spread(CAssignment, Frequency) |>separate(key, into =c("Measure", "Outcome", "Breakdown"), sep ="_") |>mutate(Overall = C0 + C1 + C2 + C3 + C4)vent_table_C <-bind_rows( vent_table_C,summarise(.data = vent_table_C,across(where(is.numeric), ~sum(.x[c(1, 2, 5)])),"Outcome"="Total","Breakdown"="" ) ) |>mutate(across(4:9, ~sprintf("%i (%.1f)", .x, 100* .x /sum(.x[c(1, 2, 5)]))) )vent_table <-left_join(vent_table_A, vent_table_C, by =c("Measure", "Outcome", "Breakdown"))kable( vent_table %>%select(-1),align ="llrrrrrrrrr") %>%kable_styling("striped", font_size =10) %>%collapse_rows(1, valign ="top", latex_hline ='custom', custom_latex_hline =1) |>pack_rows("Ventilation", 1, nrow(mort_table)) |>add_header_above(c(" "=2, "Antiviral"=3, "Anticoagulation"=5, " "=1)) |>row_spec(0, align ="c") |>column_spec(3, border_left =TRUE) |>column_spec(6, border_left =TRUE) |>column_spec(11, border_left =TRUE)```## Primary Outcome Composite```{r}#| label: tbl-po-composite#| code-summary: Summarise the composite#| tbl-cap: |#| Composite primary endpoint breakdown - overall.#| tbl-column: pagecomp_table_A <- all_data |>filter_fas_itt() |>group_by(AAssignment) |>summarise(`Primary Outcome_No_`=sum(1- PO, na.rm =TRUE),`Primary Outcome_Yes_`=sum(PO, na.rm =TRUE),`Primary Outcome_Unknown_Total`=sum(is.na(PO)),`Primary Outcome_Unknown_Day 28 status`=sum(is.na(PO) &is.na(D28_death)),`Primary Outcome_Unknown_Vasopressor/inotropes`=sum(is.na(PO) &!is.na(D28_death) &is.na(ANY_vasop)) ) |>gather(key, Frequency, -AAssignment, factor_key = T) |>spread(AAssignment, Frequency) |>separate(key, into =c("Measure", "Outcome", "Breakdown"), sep ="_")comp_table_A <-bind_rows( comp_table_A,summarise(.data = comp_table_A,across(where(is.numeric), ~sum(.x[c(1, 2, 3)])),"Outcome"="Total","Breakdown"="" ) ) |>mutate(across(4:6, ~sprintf("%i (%.1f)", .x, 100* .x /sum(.x[c(1, 2, 3)]))) )comp_table_C <- all_data |>filter_fas_itt() |>group_by(CAssignment) |>summarise(`Primary Outcome_No_`=sum(1- PO, na.rm =TRUE),`Primary Outcome_Yes_`=sum(PO, na.rm =TRUE),`Primary Outcome_Unknown_Total`=sum(is.na(PO)),`Primary Outcome_Unknown_Day 28 status`=sum(is.na(PO) &is.na(D28_death)),`Primary Outcome_Unknown_Vasopressor/inotropes`=sum(is.na(PO) &!is.na(D28_death) &is.na(ANY_vasop)) ) |>gather(key, Frequency, -CAssignment, factor_key = T) |>spread(CAssignment, Frequency) |>separate(key, into =c("Measure", "Outcome", "Breakdown"), sep ="_") |>mutate(Overall = C0 + C1 + C2 + C3 + C4)comp_table_C <-bind_rows( comp_table_C,summarise(.data = comp_table_C,across(where(is.numeric), ~sum(.x[c(1, 2, 3)])),"Outcome"="Total","Breakdown"="" ) ) |>mutate(across(4:9, ~sprintf("%i (%.1f)", .x, 100* .x /sum(.x[c(1, 2, 3)]))) )comp_table <-left_join(comp_table_A, comp_table_C, by =c("Measure", "Outcome", "Breakdown"))out <-kable( comp_table %>%select(-1),align ="llrrrrrrrrr") %>%kable_styling("striped", font_size =10, htmltable_class ="table table-striped", full_width =FALSE) %>%collapse_rows(1, valign ="top", latex_hline ='custom', custom_latex_hline =1) |>pack_rows("Primary outcome", 1, nrow(mort_table)) |>add_header_above(c(" "=2, "Antiviral"=3, "Anticoagulation"=5, " "=1)) |>row_spec(0, align ="c") |>column_spec(3, border_left =TRUE) |>column_spec(6, border_left =TRUE) |>column_spec(11, border_left =TRUE)out``````{r}#| label: tbl-po-composite-all-anticoagulation#| code-summary: Summarise the all components#| tbl-cap: |#| Composite primary endpoint breakdown for anticoagulation domain.tabC <-bind_rows(comp_table_C, mort_table_C, vaso_table_C, vent_table_C)tabC_head <- all_data %>%filter_fas_itt() %>% dplyr::count(CAssignment =factor(CAssignment, labels =c("Not<br>randomised", intervention_labels()$CAssignment[-1]))) %>%mutate(label =paste0(CAssignment, "<br>(n = ", n, ")")) %>%pull(label) %>%c(paste0("Overall<br><br>(n = ", nrow(all_data %>%filter_fas_itt()), ")"))colnames(tabC)[4:9] <- tabC_headkable( tabC %>%select(-1),align ="llrrrrrr",escape = F) %>%kable_styling(font_size =10) %>%collapse_rows(1, valign ="top", latex_hline ='custom', custom_latex_hline =1) %>%group_rows("Primary outcome", 1, nrow(comp_table_A)) %>%group_rows("Mortality", nrow(comp_table_A) +1, nrow(comp_table_A) +nrow(mort_table_A)) %>%group_rows("Vasopressor/inotropes", nrow(comp_table_A) +nrow(mort_table_A) +1, nrow(comp_table_A) +nrow(mort_table_A) +nrow(vaso_table_A)) %>%group_rows("Ventilation", nrow(comp_table_A) +nrow(mort_table_A) +nrow(vaso_table_A) +1, nrow(comp_table_A) +nrow(mort_table_A) +nrow(vaso_table_A) +nrow(vent_table_A)) %>%add_header_above(c(" "=2, "Anticoagulation"=5, " "=1))``````{r}#| label: save-composite-primary-table-anticoagulation#| code-summary: Save table to outputscolnames(tabC)[4:9] <-linebreak(tabC_head, align ="c", linebreaker ="<br>")out <-kable( tabC %>%select(-1),format ="latex",align ="llrrrrrr",booktabs =TRUE,escape = F) %>%kable_styling(font_size =8, latex_options ="HOLD_position") %>%collapse_rows(1, valign ="top", latex_hline ='none') %>%group_rows("Primary outcome", 1, nrow(comp_table_A)) %>%group_rows("Mortality", nrow(comp_table_A) +1, nrow(comp_table_A) +nrow(mort_table_A)) %>%group_rows("Vasopressor/inotropes", nrow(comp_table_A) +nrow(mort_table_A) +1, nrow(comp_table_A) +nrow(mort_table_A) +nrow(vaso_table_A)) %>%group_rows("Ventilation", nrow(comp_table_A) +nrow(mort_table_A) +nrow(vaso_table_A) +1, nrow(comp_table_A) +nrow(mort_table_A) +nrow(vaso_table_A) +nrow(vent_table_A)) %>%add_header_above(c(" "=2, "Anticoaguation"=5, " "=1)) %>%landscape()save_tex_table(out, fn ="outcomes/primary/composite-breakdown-anticoagulation")``````{r}#| label: tbl-po-composite-all-antiviral#| code-summary: Summarise the all components#| tbl-cap: |#| Composite primary endpoint breakdown for antiviral domain.tabA <-bind_rows(bind_cols(comp_table_A, comp_table_C[, ncol(comp_table_C)]),bind_cols(mort_table_A, mort_table_C[, ncol(mort_table_C)]),bind_cols(vaso_table_A, vaso_table_C[, ncol(vaso_table_C)]), bind_cols(vent_table_A, vent_table_C[, ncol(vent_table_C)]))tabA_head <- all_data %>%filter_fas_itt() %>% dplyr::count(AAssignment =factor(AAssignment, labels =intervention_labels()$AAssignment)) %>%mutate(label =paste0(AAssignment, "<br>(n = ", n, ")")) %>%pull(label) %>%c(paste0("Overall<br><br>(n = ", nrow(all_data %>%filter_fas_itt()), ")"))colnames(tabA)[4:7] <- tabA_headkable( tabA %>%select(-1),align ="llrrrrr",escape = F) %>%kable_styling(font_size =11) %>%collapse_rows(1, valign ="top", latex_hline ='custom', custom_latex_hline =1) %>%group_rows("Primary outcome", 1, nrow(comp_table_A)) %>%group_rows("Mortality", nrow(comp_table_A) +1, nrow(comp_table_A) +nrow(mort_table_A)) %>%group_rows("Vasopressor/inotropes", nrow(comp_table_A) +nrow(mort_table_A) +1, nrow(comp_table_A) +nrow(mort_table_A) +nrow(vaso_table_A)) %>%group_rows("Ventilation", nrow(comp_table_A) +nrow(mort_table_A) +nrow(vaso_table_A) +1, nrow(comp_table_A) +nrow(mort_table_A) +nrow(vaso_table_A) +nrow(vent_table_A)) %>%add_header_above(c(" "=2, "Antiviral"=3, " "=1))``````{r}#| label: save-composite-primary-table-antiviral#| code-summary: Save table to outputscolnames(tabA)[4:7] <-linebreak(tabA_head, align ="c", linebreaker ="<br>")out <-kable( tabA %>%select(-1),format ="latex",align ="llrrrrr",booktabs =TRUE,escape = F) %>%kable_styling(font_size =8, latex_options ="HOLD_position") %>%collapse_rows(1, valign ="top", latex_hline ='none') %>%group_rows("Primary outcome", 1, nrow(comp_table_A)) %>%group_rows("Mortality", nrow(comp_table_A) +1, nrow(comp_table_A) +nrow(mort_table_A)) %>%group_rows("Vasopressor/inotropes", nrow(comp_table_A) +nrow(mort_table_A) +1, nrow(comp_table_A) +nrow(mort_table_A) +nrow(vaso_table_A)) %>%group_rows("Ventilation", nrow(comp_table_A) +nrow(mort_table_A) +nrow(vaso_table_A) +1, nrow(comp_table_A) +nrow(mort_table_A) +nrow(vaso_table_A) +nrow(vent_table_A)) %>%add_header_above(c(" "=2, "Antiviral"=3, " "=1))save_tex_table(out, fn ="outcomes/primary/composite-breakdown-antiviral")```## Summarise Primary Outcome```{r}make_po_table_A <-function(dat, format ="html") { tab <- dat %>%mutate(AAssignment =factor( AAssignment, levels =paste0("A", 0:2),labels =intervention_labels()$AAssignment) ) %>%group_by(AAssignment) %>%summarise(Randomised =n(),`Outcome missing`=sprintf("%i (%.1f)", sum(is.na(PO)), 100*mean(is.na(PO))),`Outcome observed`=sprintf("%i (%.1f)", sum(!is.na(PO)), 100*mean(!is.na(PO))),`Met primary outcome`=sprintf("%i (%.1f)", sum(PO, na.rm =TRUE), 100*mean(PO, na.rm =TRUE)), ) %>%bind_rows( dat %>%group_by(AAssignment ="Overall") %>%summarise(Randomised =n(),`Outcome missing`=sprintf("%i (%.1f)", sum(is.na(PO)), 100*mean(is.na(PO))),`Outcome observed`=sprintf("%i (%.1f)", sum(!is.na(PO)), 100*mean(!is.na(PO))),`Met primary outcome`=sprintf("%i (%.1f)", sum(PO, na.rm =TRUE), 100*mean(PO, na.rm =TRUE)), ) ) %>%mutate(AAssignment =fct_inorder(AAssignment)) %>%gather(key, value, -AAssignment, factor_key = T) %>%spread(AAssignment, value)colnames(tab)[1] <-"n (\\%)"if(format =="latex") {colnames(tab) <-linebreak(colnames(tab), align ="c", linebreaker ="<br>") }kable(tab,format = format,align ="lrrrrr",escape =FALSE,booktabs =TRUE ) %>%kable_styling(font_size =9, latex_options ="HOLD_position") }make_po_table_C <-function(dat, format ="html") { tab <- dat %>%mutate(CAssignment =factor( CAssignment, levels =paste0("C", 0:4),labels =intervention_labels()$CAssignment) ) %>%group_by(CAssignment) %>%summarise(Randomised =n(),`Outcome missing`=sprintf("%i (%.1f)", sum(is.na(PO)), 100*mean(is.na(PO))),`Outcome observed`=sprintf("%i (%.1f)", sum(!is.na(PO)), 100*mean(!is.na(PO))),`Met primary outcome`=sprintf("%i (%.1f)", sum(PO, na.rm =TRUE), 100*mean(PO, na.rm =TRUE)), ) %>%bind_rows( dat %>%group_by(CAssignment ="Overall") %>%summarise(Randomised =n(),`Outcome missing`=sprintf("%i (%.1f)", sum(is.na(PO)), 100*mean(is.na(PO))),`Outcome observed`=sprintf("%i (%.1f)", sum(!is.na(PO)), 100*mean(!is.na(PO))),`Met primary outcome`=sprintf("%i (%.1f)", sum(PO, na.rm =TRUE), 100*mean(PO, na.rm =TRUE)), ) ) %>%mutate(CAssignment =fct_inorder(CAssignment)) %>%gather(key, value, -CAssignment, factor_key = T) %>%spread(CAssignment, value)colnames(tab)[1] <-"n (\\%)"if(format =="latex") {colnames(tab) <-linebreak(colnames(tab), align ="c", linebreaker ="<br>") }kable(tab,format = format,align ="lrrrrrr",escape =FALSE,booktabs =TRUE ) %>%kable_styling(font_size =9, latex_options ="HOLD_position") }``````{r}#| label: tbl-domainC-po#| code-summary: Relationship anti-coagulation to outcome#| tbl-cap: Primary outcome by anti-coagulation intervention.make_po_table_C( all_data %>%filter_acs_itt())save_tex_table(make_po_table_C( all_data %>%filter_acs_itt(),"latex"), "outcomes/primary/anticoagulation-summary")``````{r}#| label: tbl-domainA-po#| code-summary: Relationship anti-viral to outcome#| tbl-cap: Primary outcome by anti-viral intervention.make_po_table_A( all_data %>%filter_avs_itt())save_tex_table(make_po_table_A( all_data %>%filter_avs_itt(),"latex"), "outcomes/primary/antiviral-summary")```# Descriptive Analyses## By Interim Analysis```{r}intdatC <- fas_itt_dat |>mutate(interim =as.character(case_when( RandDate <get_interim_dates()$meet_date[1] ~1, RandDate <get_interim_dates()$meet_date[2] ~2, RandDate <get_interim_dates()$meet_date[3] ~3, RandDate <get_interim_dates()$meet_date[4] ~4, RandDate <get_interim_dates()$meet_date[5] ~5,TRUE~5 )),CAssignment =factor( CAssignment, labels =intervention_labels_short_break()$CAssignment) )intcounts <- intdatC %>% dplyr::count(interim) %>%mutate(label =paste0("Interim ", interim, " (n = ", n, ")"))trtcountsC <- intdatC %>% dplyr::count(CAssignment)ovrtabC <- intdatC %>%group_by(interim ="Overall", CAssignment) %>%summarise(Randomised =sprintf("%i", n()),Known =sprintf("%i (%.0f)", sum(!is.na(PO)), 100*mean(!is.na(PO))),`Met primary outcome`=sprintf("%i (%.0f)", sum(PO, na.rm = T), 100*mean(PO, na.rm = T)),`Death`=sprintf("%i (%.0f)", sum(D28_death, na.rm = T), 100*sum(D28_death, na.rm = T) /sum(!is.na(PO))),`Vasopressor/inotropic support`=sprintf("%i (%.0f)", sum(ANY_vasop, na.rm = T), 100*sum(ANY_vasop, na.rm = T) /sum(!is.na(PO))),`Intensive respiratory support`=sprintf("%i (%.0f)", sum(ANY_vent, na.rm = T), 100*sum(ANY_vent, na.rm = T) /sum(!is.na(PO))) ) %>%pivot_longer(`Randomised`:`Intensive respiratory support`, names_to ="Outcome") %>%pivot_wider(names_from = CAssignment, values_from = value, values_fill ="-")inttabC <- intdatC %>%group_by(interim, CAssignment) %>%summarise(Randomised =sprintf("%i", n()),Known =sprintf("%i (%.0f)", sum(!is.na(PO)), 100*mean(!is.na(PO))),`Met primary outcome`=sprintf("%i (%.0f)", sum(PO, na.rm = T), 100*mean(PO, na.rm = T)),`Death`=sprintf("%i (%.0f)", sum(D28_death, na.rm = T), 100*sum(D28_death, na.rm = T) /sum(!is.na(PO))),`Vasopressor/inotropic support`=sprintf("%i (%.0f)", sum(ANY_vasop, na.rm = T), 100*sum(ANY_vasop, na.rm = T) /sum(!is.na(PO))),`Intensive respiratory support`=sprintf("%i (%.0f)", sum(ANY_vent, na.rm = T), 100*sum(ANY_vent, na.rm = T) /sum(!is.na(PO))) ) %>%pivot_longer(`Randomised`:`Intensive respiratory support`, names_to ="Outcome") %>%pivot_wider(names_from = CAssignment, values_from = value, values_fill ="-")tabC <-bind_rows(ovrtabC, inttabC)colnames(tabC) <-linebreak(colnames(tabC), align ="c")savetab <-kable( tabC[, -1],format ="latex",align ="lrrrr",booktabs =TRUE) %>%kable_styling(font_size =9,latex_options ="HOLD_position" ) %>%group_rows(paste0("Overall (n = ", sum(intcounts$n), ")"), 1, 6) %>%group_rows(intcounts$label[1], 7, 12) %>%group_rows(intcounts$label[2], 13, 18) %>%group_rows(intcounts$label[3], 19, 24) %>%group_rows(intcounts$label[4], 25, 30) %>%group_rows(intcounts$label[5], 31, 36)save_tex_table(savetab, fn ="outcomes/primary/primary-composite-interims-anticoagulation")kable( tabC[, -1],format ="html",align ="lrrrr",) %>%kable_styling(font_size =9,latex_options ="HOLD_position" ) %>%group_rows(paste0("Overall (n = ", sum(intcounts$n), ")"), 1, 6) %>%group_rows(intcounts$label[1], 7, 12) %>%group_rows(intcounts$label[2], 13, 18) %>%group_rows(intcounts$label[3], 19, 24) %>%group_rows(intcounts$label[4], 25, 30) %>%group_rows(intcounts$label[5], 31, 36)``````{r}intdatA <- fas_itt_dat |>mutate(interim =as.character(case_when( RandDate <get_interim_dates()$meet_date[1] ~1, RandDate <get_interim_dates()$meet_date[2] ~2, RandDate <get_interim_dates()$meet_date[3] ~3, RandDate <get_interim_dates()$meet_date[4] ~4, RandDate <get_interim_dates()$meet_date[5] ~5,TRUE~5 )),AAssignment =factor( AAssignment, labels =intervention_labels_short_break()$AAssignment) )intcounts <- intdatA %>% dplyr::count(interim) %>%mutate(label =paste0("Interim ", interim, " (n = ", n, ")"))trtcountsA <- intdatA %>% dplyr::count(AAssignment)ovrtabA <- intdatA %>%group_by(interim ="Overall", AAssignment) %>%summarise(Randomised =sprintf("%i", n()),Known =sprintf("%i (%.0f)", sum(!is.na(PO)), 100*mean(!is.na(PO))),`Met primary outcome`=sprintf("%i (%.0f)", sum(PO, na.rm = T), 100*mean(PO, na.rm = T)),`Death`=sprintf("%i (%.0f)", sum(D28_death, na.rm = T), 100*sum(D28_death, na.rm = T) /sum(!is.na(PO))),`Vasopressor/inotropic support`=sprintf("%i (%.0f)", sum(ANY_vasop, na.rm = T), 100*sum(ANY_vasop, na.rm = T) /sum(!is.na(PO))),`Intensive respiratory support`=sprintf("%i (%.0f)", sum(ANY_vent, na.rm = T), 100*sum(ANY_vent, na.rm = T) /sum(!is.na(PO))) ) %>%pivot_longer(`Randomised`:`Intensive respiratory support`, names_to ="Outcome") %>%pivot_wider(names_from = AAssignment, values_from = value, values_fill ="-")inttabA <- intdatA %>%group_by(interim, AAssignment) %>%summarise(Randomised =sprintf("%i", n()),Known =sprintf("%i (%.0f)", sum(!is.na(PO)), 100*mean(!is.na(PO))),`Met primary outcome`=sprintf("%i (%.0f)", sum(PO, na.rm = T), 100*mean(PO, na.rm = T)),`Death`=sprintf("%i (%.0f)", sum(D28_death, na.rm = T), 100*sum(D28_death, na.rm = T) /sum(!is.na(PO))),`Vasopressor/inotropic support`=sprintf("%i (%.0f)", sum(ANY_vasop, na.rm = T), 100*sum(ANY_vasop, na.rm = T) /sum(!is.na(PO))),`Intensive respiratory support`=sprintf("%i (%.0f)", sum(ANY_vent, na.rm = T), 100*sum(ANY_vent, na.rm = T) /sum(!is.na(PO))) ) %>%pivot_longer(`Randomised`:`Intensive respiratory support`, names_to ="Outcome") %>%pivot_wider(names_from = AAssignment, values_from = value, values_fill ="-")tabA <-bind_rows(ovrtabA, inttabA)colnames(tabA) <-linebreak(colnames(tabA), align ="c")savetab <-kable( tabA[, -1],format ="latex",align ="lrrrr",booktabs =TRUE) %>%kable_styling(font_size =9,latex_options ="HOLD_position" ) %>%group_rows(paste0("Overall (n = ", sum(intcounts$n), ")"), 1, 6) %>%group_rows(intcounts$label[1], 7, 12) %>%group_rows(intcounts$label[2], 13, 18) %>%group_rows(intcounts$label[3], 19, 24) %>%group_rows(intcounts$label[4], 25, 30) %>%group_rows(intcounts$label[5], 31, 36)save_tex_table(savetab, fn ="outcomes/primary/primary-composite-interims-antiviral")kable( tabA[, -1],format ="html",align ="lrrrr",) %>%kable_styling(font_size =9,latex_options ="HOLD_position" ) %>%group_rows(paste0("Overall (n = ", sum(intcounts$n), ")"), 1, 6) %>%group_rows(intcounts$label[1], 7, 12) %>%group_rows(intcounts$label[2], 13, 18) %>%group_rows(intcounts$label[3], 19, 24) %>%group_rows(intcounts$label[4], 25, 30) %>%group_rows(intcounts$label[5], 31, 36)``````{r}tab <-bind_cols(tabA, tabC[, -(1:2)])savetab <-kable( tab[, -1],format ="latex",align ="lrrrrrrrr",booktabs =TRUE,escape =FALSE) %>%kable_styling(font_size =7,latex_options ="HOLD_position" ) %>%group_rows(paste0("Overall (n = ", sum(intcounts$n), ")"), 1, 6) %>%group_rows(intcounts$label[1], 7, 12) %>%group_rows(intcounts$label[2], 13, 18) %>%group_rows(intcounts$label[3], 19, 24) %>%group_rows(intcounts$label[4], 25, 30) %>%group_rows(intcounts$label[5], 31, 36) %>%add_header_above(c(" "=1, "Domain A"=3, "Domain C"=5))save_tex_table(savetab, fn ="outcomes/primary/primary-composite-interims")kable( tab[, -1],format ="html",align ="lrrrrrrrr",escape = F) %>%kable_styling(font_size =9,latex_options ="HOLD_position" ) %>%group_rows(paste0("Overall (n = ", sum(intcounts$n), ")"), 1, 6) %>%group_rows(intcounts$label[1], 7, 12) %>%group_rows(intcounts$label[2], 13, 18) %>%group_rows(intcounts$label[3], 19, 24) %>%group_rows(intcounts$label[4], 25, 30) %>%group_rows(intcounts$label[5], 31, 36) %>%add_header_above(c(" "=1, "Domain A"=3, "Domain C"=5))```## InterventionThe following presents the primary outcome rate by antiviral intervention```{r}#| label: fig-antiviral-po#| code-summary: Relationship antiviral to outcome#| fig-cap: Primary outcome by assigned antiviral (AVS-ITT).#| fig-height: 2tdat <- all_data %>%filter_avs_itt() %>%count(Antiviral =factor(AAssignment, labels =intervention_labels_short()$AAssignment[-1]), PO) %>%group_by(Antiviral) %>%spread(PO, n, fill =0) %>%mutate(n =`1`+`0`,p_1 =`1`/ (`1`+`0`),p_miss =0/ (`1`+`0`) )p1 <-ggplot(tdat, aes(Antiviral, n)) +geom_col() +labs(y ="Number of\nparticipants", x ="Antiviral")p2 <-ggplot(tdat, aes(Antiviral, p_1)) +geom_point() +labs(y ="Proportion meeting\nprimary outcome", x ="Antiviral") +ylim(0, NA)p <- p1 | p2path <-file.path("outputs", "figures", "outcomes", "primary")ggsave(file.path(path, "outcome-antiviral.pdf"), p, height =2, width =6)p```## AgeThe following presents the primary outcome rate by age in years.```{r}#| label: fig-age-po#| code-summary: Relationship age to outcome#| fig-cap: |#| Relationship (logistic regression linear in age) #| between age at entry and the primary outcome.#| fig-height: 2agedat <- fas_itt_dat %>% dplyr::count(PO, AgeAtEntry) %>%spread(PO, n, fill =0) %>%mutate(n =`0`+`1`+`<NA>`,p =`1`/ (`1`+`0`))agemod <-glm(cbind(`1`, `0`) ~ AgeAtEntry, data = agedat, family =binomial())agedat <- agedat %>%mutate(ypred =predict(agemod, newdata = agedat, type ="response") )p1 <-ggplot(agedat, aes(AgeAtEntry, n)) +geom_col(colour ="grey40", fill ="grey40") +geom_vline(xintercept =60, linetype =2) +labs(y ="Number of\nparticipants",x ="Age at entry")p2 <-ggplot(agedat, aes(AgeAtEntry, p)) +geom_point() +geom_vline(xintercept =60, linetype =2) +geom_line(aes(y = ypred)) +labs(y ="Proportion\nwith outcome", x ="Age at entry")p <- p1 | p2path <-file.path("outputs", "figures", "outcomes", "primary")ggsave(file.path(path, "outcome-age.pdf"), p, height =2, width =6)p```## Sex```{r}#| label: fig-sex-po#| code-summary: Relationship sex to outcome#| fig-cap: Primary outcome by sex#| fig-height: 2tdat <- all_data %>%filter_fas_itt() %>%count(Sex, PO) %>%group_by(Sex) %>%spread(PO, n, fill =0) %>%mutate(n =`1`+`0`+`<NA>`,p_1 =`1`/ (`1`+`0`),p_miss =`<NA>`/ (`1`+`0`+`<NA>`) )p1 <-ggplot(tdat, aes(Sex, n)) +geom_col() +labs(y ="Number of\nparticipants", x ="Sex")p2 <-ggplot(tdat, aes(Sex, p_1)) +geom_point() +labs(y ="Proportion meeting\nprimary outcome", x ="Sex") +ylim(0, NA)p <- p1 | p2path <-file.path("outputs", "figures", "outcomes", "primary")ggsave(file.path(path, "outcome-sex.pdf"), p, height =2, width =6)p```## Oxygen requirement```{r}#| label: fig-oxygen-po#| code-summary: Relationship supplemental oxygen to outcome#| fig-cap: Primary outcome by supplemental oxygen#| fig-height: 2tdat <- all_data %>%filter_fas_itt() %>%count(`Supplemental oxygen`=factor(supp_oxy2, labels =c("Not required", "Required")), PO) %>%group_by(`Supplemental oxygen`) %>%spread(PO, n, fill =0) %>%mutate(n =`1`+`0`+`<NA>`,p_1 =`1`/ (`1`+`0`),p_miss =`<NA>`/ (`1`+`0`+`<NA>`) )p1 <-ggplot(tdat, aes(`Supplemental oxygen`, n)) +geom_col() +labs(y ="Number of\nparticipants")p2 <-ggplot(tdat, aes(`Supplemental oxygen`, p_1)) +geom_point() +labs(y ="Proportion meeting\nprimary outcome") +ylim(0, NA)p <- p1 | p2path <-file.path("outputs", "figures", "outcomes", "primary")ggsave(file.path(path, "outcome-oxygen.pdf"), p, height =2, width =6)p``````{r}#| label: tbl-oxy-po#| code-summary: Relationship oxygen requirement to outcometdat <- all_data %>%filter_fas_itt() %>%count(`Oxygen requirement`=fct_explicit_na(factor(supp_oxy, levels =0:1, labels =c("No", "Yes"))), PO) %>%group_by(`Oxygen requirement`) %>%spread(PO, n, fill =0) %>%mutate(Total =`1`+`0`+`<NA>`,No =sprintf("%i (%.0f)", `0`, 100*`0`/ (`1`+`0`)),Yes =sprintf("%i (%.0f)", `1`, 100*`1`/ (`1`+`0`)),Unknown =sprintf("%i (%.0f)", `<NA>`, 100*`1`/ Total) ) |>select(-`0`, -`1`, -`<NA>`)kable(tdat, align ="lrrrr") |>kable_styling("striped", font_size =12)```## CountryThe following presents the primary outcome rate by country.```{r}#| label: fig-country-po#| code-summary: Relationship country to outcome#| fig-cap: Primary outcome by country.#| fig-height: 2tdat <- all_data %>%filter_fas_itt() %>%count(Country =factor(PT_CountryName, levels =c("India", "Australia", "Nepal", "New Zealand")), PO) %>%group_by(Country) %>%spread(PO, n, fill =0) %>%mutate(n =`1`+`0`+`<NA>`,p_1 =`1`/ (`1`+`0`),p_miss =`<NA>`/ (`1`+`0`+`<NA>`) )p1 <-ggplot(tdat, aes(Country, n)) +geom_col() +labs(y ="Number of\nparticipants", x ="Country of enrolment")p2 <-ggplot(tdat, aes(Country, p_1)) +geom_point() +labs(y ="Proportion meeting\nprimary outcome", x ="Country of enrolment") +ylim(0, NA)p <- p1 | p2path <-file.path("outputs", "figures", "outcomes", "primary")ggsave(file.path(path, "outcome-country.pdf"), p, height =2, width =6)p``````{r}#| label: fig-country-po-avs#| code-summary: Relationship country to outcome#| fig-cap: Primary outcome by country.#| fig-height: 2tdat <- all_data %>%filter_avs_itt() %>%count(Country =factor(PT_CountryName, levels =c("Australia", "Nepal", "New Zealand")), AAssignment =factor(AAssignment, labels =c("Usual care", "Nafamostat")), PO) %>%group_by(Country) %>%spread(PO, n, fill =0) %>%mutate(n =`1`+`0`,p_1 =`1`/ (`1`+`0`) )p1 <-ggplot(tdat, aes(AAssignment, n)) +facet_wrap( ~ Country, ncol =1, scales ="free_y") +geom_col() +labs(y ="Number of\nparticipants", x ="Antiviral intervention") +scale_y_continuous(breaks =function(x) unique(floor(pretty(seq(0, (max(x) +1) *1.1)))))p2 <-ggplot(tdat, aes(AAssignment, p_1)) +facet_wrap( ~ Country, ncol =1, scales ="free_y") +geom_point() +labs(y ="Proportion meeting\nprimary outcome", x ="Antiviral intervention") +scale_y_continuous(limits =c(0, NA)) +expand_limits(y =0.1) +facetted_pos_scales(y =list(scale_y_continuous(breaks =seq(0, 0.1, 0.02), limits =c(0, 0.1)),scale_y_continuous(breaks =seq(0, 0.1, 0.02), limits =c(0, 0.1)),scale_y_continuous(breaks =seq(0, 1, 0.1), limits =c(0, NA), labels = \(x) sprintf("%.2f", x)) ))p <- p1 | p2path <-file.path("outputs", "figures", "outcomes", "primary")fpth <-file.path(path, "outcome-country-avs-itt.pdf") ggsave(fpth, p, height =4, width =6)system(sprintf("pdftoppm %s %s -png", fpth, gsub(".pdf", "", fpth)))p```## SiteThe following presents the primary outcome rate by study site.```{r}#| label: fig-site-po#| code-summary: Relationship site to outcome#| fig-cap: Primary outcome by site within country.#| fig-height: 4tdat <- all_data %>%filter_fas_itt() %>% dplyr::count(Country_lab = Country,Site_lab =fct_infreq(Location),Country =factor(PT_CountryName, levels =c("India", "Australia", "Nepal", "New Zealand")),Site = PT_LocationName, PO) %>%group_by(Country, Site) %>%spread(PO, n, fill =0) %>%mutate(n =`1`+`0`+`<NA>`,p_1 =`1`/ (`1`+`0`),p_miss =`<NA>`/ (`1`+`0`+`<NA>`) ) %>%ungroup()p1 <-ggplot(tdat, aes(Site_lab, n)) +facet_grid( ~ Country, scales ="free_x", space ="free_x") +geom_col() +labs(y ="Number of\nparticipants", x ="") +theme(axis.text.x =element_text(angle =45, hjust =1),panel.border =element_rect(fill =NA))p2 <-ggplot(tdat, aes(Site_lab, p_1)) +facet_grid( ~ Country, scales ="free_x", space ="free_x") +geom_point() +labs(y ="Proportion meeting\nprimary outcome", x ="Site of enrolment") +theme(axis.text.x =element_text(angle =45, hjust =1),panel.border =element_rect(fill =NA))p <- p1 / p2path <-file.path("outputs", "figures", "outcomes", "primary")ggsave(file.path(path, "outcome-country-site.pdf"), p, height =4, width =6.25)p``````{r}#| label: fig-site-po-avs#| code-summary: Relationship site to outcome#| fig-cap: Primary outcome by site within country.#| fig-height: 6#| fig-width: 4tdat <- all_data %>%filter_avs_itt() %>% dplyr::count(Country_lab = Country,Site_lab =fct_infreq(Location),Country =factor(PT_CountryName, labels =c("Australia", "Nepal", "New\nZealand")),Site = PT_LocationName,AAssignment =factor(AAssignment, labels =c("Usual care", "Nafamostat")), PO) %>%group_by(Country, Site, AAssignment) %>%spread(PO, n, fill =0) %>%mutate(n =`1`+`0`,p_1 =`1`/ (`1`+`0`), ) %>%ungroup()p1 <-ggplot(tdat, aes(Site_lab, n)) +facet_grid(Country ~ ., scales ="free_y", space ="free_y", switch ="both") +geom_col(aes(fill = AAssignment), width =0.85) +labs(y ="Number of\nparticipants", x ="Site of enrolment",fill ="Antiviral") +coord_flip() +scale_fill_viridis_d() +theme(panel.border =element_rect(fill =NA),panel.grid.major.y =element_line(colour ="grey80", linetype =2),strip.placement ="outside")p2 <-ggplot(tdat, aes(Site_lab, p_1)) +facet_grid(Country ~ ., scales ="free_y", space ="free_y", switch ="both") +geom_point(aes(fill = AAssignment, colour = AAssignment), shape =21, position =position_dodge(0.5)) +labs(y ="Proportion meeting\nprimary outcome", x ="") +coord_flip() +scale_colour_viridis_d() +scale_fill_viridis_d() +theme(panel.border =element_rect(fill =NA),panel.grid.major.y =element_line(colour ="grey80", linetype =2),strip.placement ="outside",# axis.text.y = element_blank(),axis.title.y =element_blank(),strip.text.y =element_blank()) +guides(fill ="none", colour ="none")p <- (p1 | p2) +plot_layout(guides ="collect") &theme(legend.position ="top")path <-file.path("outputs", "figures", "outcomes", "primary")fpth <-file.path(path, "outcome-country-site-avs-itt.pdf")ggsave(fpth, p, height =5, width =6, dpi =244)system(sprintf("pdftoppm %s %s -png", fpth, gsub(".pdf", "", fpth)))p```## Calendar Time```{r}#| label: fig-cal-po#| code-summary: Relationship calendar date to outcome#| fig-cap: |#| Relationship between calendar date and the primary outcome.#| fig-height: 2caldat <- fas_itt_dat %>% dplyr::count(PO, yr =year(RandDate), mth =month(RandDate)) %>%spread(PO, n, fill =0) %>%mutate(p =`1`/ (`1`+`0`),n =`1`+`0`)p1 <-ggplot(caldat, aes(mth, p)) +facet_grid( ~ yr, drop = T, scales ="free_x", space ="free") +geom_point() +labs(y ="Proportion meeting\nprimary outcome", x ="Calendar date (month of year)") +scale_x_continuous(breaks =1:12) +ylim(0, 0.25)p2 <-ggplot(caldat, aes(mth, n)) +facet_grid( ~ yr, drop = T, scales ="free_x", space ="free") +geom_col() +labs(y ="Number of\nparticipants", x ="Calendar date (month of year)") +scale_x_continuous(breaks =1:12)p <- p2 | p1path <-file.path("outputs", "figures", "outcomes", "primary")ggsave(file.path(path, "outcome-calendar-time.pdf"), p, height =2, width =6)p```There was interest in investigating a cut-point of calendar time due to changes in the predominant circulating variant.A proposed cut-point was 2021-12-20.```{r}#| label: fig-cal-po-grp-fas-itt#| code-summary: Relationship calendar date to outcome by cut-point, FAS-ITT#| fig-cap: |#| Relationship between calendar date and the primary outcome by cut-point, FAS-ITT.#| fig-height: 2caldat <- fas_itt_dat %>% dplyr::count(PO, grp =factor( RandDate >=as.Date("2021-12-20"), labels =c("< 2021-12-20", "\u2265 2021-12-20"))) %>%spread(PO, n, fill =0) %>%mutate(p =`1`/ (`1`+`0`),n =`1`+`0`)p1 <-ggplot(caldat, aes(grp, n)) +geom_col() +labs(y ="Number of\nparticipants", x ="Randomisation date")p2 <-ggplot(caldat, aes(grp, p)) +geom_point() +labs(y ="Proportion meeting\nprimary outcome", x ="Randomisation date") +ylim(0, NA)p <- p1 | p2path <-file.path("outputs", "figures", "outcomes", "primary")ggsave(file.path(path, "outcome-calendar-time-group-fas-itt.pdf"), p, height =2, width =6, device = cairo_pdf)p``````{r}#| label: fig-cal-po-grp-avs-itt#| code-summary: Relationship calendar date to outcome by cut-point, AVS-ITT#| fig-cap: |#| Relationship between calendar date and the primary outcome by cut-point, AVS-ITT.#| fig-height: 2caldat <- avs_itt_dat %>% dplyr::count(PO, grp =factor( RandDate >=as.Date("2021-12-20"), labels =c("< 2021-12-20", "\u2265 2021-12-20"))) %>%spread(PO, n, fill =0) %>%mutate(p =`1`/ (`1`+`0`),n =`1`+`0`)p1 <-ggplot(caldat, aes(grp, n)) +geom_col() +labs(y ="Number of\nparticipants", x ="Randomisation date")p2 <-ggplot(caldat, aes(grp, p)) +geom_point() +labs(y ="Proportion meeting\nprimary outcome", x ="Randomisation date") +ylim(0, NA)p <- p1 | p2path <-file.path("outputs", "figures", "outcomes", "primary")ggsave(file.path(path, "outcome-calendar-time-group-avs-itt.pdf"), p, height =2, width =6, device = cairo_pdf)p```## Baseline CRP```{r}#| label: tbl-crp-po#| code-summary: Relationship CRP to outcome#| tbl-cap: Relationship between CRP and primary outcome, AVS-ITT.tdat <- avs_itt_dat %>%count(`Baseline CRP`= crp_tertile, PO) %>%group_by(`Baseline CRP`) %>%spread(PO, n, fill =0) %>%mutate(Total =`1`+`0`,No =sprintf("%i (%.0f)", `0`, 100*`0`/ (`1`+`0`)),Yes =sprintf("%i (%.0f)", `1`, 100*`1`/ (`1`+`0`)),Unknown =sprintf("%i (%.0f)", 0, 100*`1`/ Total) ) |>select(-`0`, -`1`)kable(tdat, align ="lrrrr") |>kable_styling("striped", font_size =12)```## Days since symptom onset```{r}#| label: fig-dsfs-po#| code-summary: Relationship days since sympton onset to outcome#| fig-cap: |#| Relationship (logistic regression linear) #| between days since symptom onset at entry and the primary outcome.#| fig-height: 2dsfsdat <- fas_itt_dat %>% dplyr::count(PO, dsfs) %>%spread(PO, n, fill =0) %>%mutate(n =`1`+`0`,p =`1`/ (`1`+`0`))dsfsmod <-glm(cbind(`1`, `0`) ~ dsfs, data = dsfsdat, family =binomial())dsfsdat <- dsfsdat %>%mutate(ypred =predict(dsfsmod, newdata = dsfsdat, type ="response") )p1 <-ggplot(dsfsdat, aes(dsfs, n)) +geom_col(colour ="grey40", fill ="grey40") +geom_vline(xintercept =7.5, linetype =2) +labs(y ="Number of\nparticipants",x ="Days since first symptoms")p2 <-ggplot(dsfsdat, aes(dsfs, p)) +geom_point() +geom_vline(xintercept =7.5, linetype =2) +geom_line(aes(y = ypred)) +labs(y ="Proportion\nwith outcome", x ="Days since first symptoms")p <- p1 | p2path <-file.path("outputs", "figures", "outcomes", "primary")ggsave(file.path(path, "outcome-dsfs.pdf"), p, height =2, width =6)p```# MLE EstimatesAs a point of reference, treatment only logistic regression models are estimated using maximum likelihood for each of the 3 analysis sets.These are obviously inappropriate given the design, but provide some reference values.## FAS-ITT```{r}#| label: tbl-fas-itt-trt-only-mle#| tbl-cap: Maximum likelihood odds ratio estimates for FAS-ITT set.fas_itt_mle <-glmer( PO ~ facA + facC + inelgc3 + agegte60 + supp_oxy2 + ctry + (1| epoch),data = fas_itt_nona_dat, family =binomial())tidy(fas_itt_mle, conf.int =TRUE, exponentiate =TRUE) |>kable(digits =2) |>kable_styling("striped", font_size =12)```## ACS-ITT```{r}#| label: tbl-acs-itt-trt-only-mle#| tbl-cap: Maximum likelihood odds ratio estimates for ACS-ITT set.acs_itt_mle <-glmer( PO ~ facA + facC + inelgc3 + agegte60 + supp_oxy2 + ctry + (1| epoch), data = acs_itt_nona_dat, family =binomial())tidy(acs_itt_mle, conf.int =TRUE, exponentiate =TRUE) |>kable(digits =2) |>kable_styling("striped", font_size =12)```## AVS-ITT```{r}#| label: tbl-avs-itt-trt-only-mle#| tbl-cap: Maximum likelihood odds ratio estimates for AVS-ITT set.avs_itt_mle <-glm(PO ~ facA + supp_oxy2, data = avs_itt_nona_dat, family =binomial())tidy(avs_itt_mle, conf.int =TRUE, exponentiate =TRUE) |>kable(digits =2) |>kable_styling("striped", font_size =12)```# AnalysesThe SAP specified the primary analyses as using the AVS-ITT set with terms for:- all treatments (including ineligibilities and not-randomised terms)- region- site- epoch- age- sex- oxygen requirement- C-reactive protein.This was to be repeated for FAS-ITT.Some general notes:- there were concerns with the accuracy of C-reactive protein values reported in India (incorrect units reported, unrealistic values), therefore CRP is treated as unknown for Indian participants (most participants). Therefore, CRP is included for models using AVS-ITT but excluded for models using FAS-ITT.- all interventions in AVS-ITT were concurrently randomised. Therefore, epoch is excluded from the AVS-ITT model.- due to insufficient data, there are concerns that too many model parameters are included when restricting to AVS-ITT. The model parameters will be largely driven by the pre-specified priors for many of the adjustment variables. Therefore, an antiviral-treatment only model was also investigated- to assess prior sensitivity analyses are repeated with diffuse and sceptical priors on treatment variances, and assuming treatment coding on the effect terms rather than orthonormal coding.## FAS-ITT### Pre-specified prior```{r}res <-fit_primary_model(fas_itt_nona_dat, logistic_site_epoch, ctr = contr.equalprior)names(res$drws$AOR) <-"Nafamostat"names(res$drws$COR) <-intervention_labels2()$CAssignment[-(1:2)]names(res$drws$OR)[-1] <-c("Ineligible aspirin", "Age \u2265 60", "Female", "Oxygen requirement", "Australia/New Zealand", "Nepal")saveRDS(res, file.path("outputs", "models", "primary", "fas-itt-default.rds"))```Using FAS-ITT (excluding participants with missing primary outcome) and the pre-specified primary model (excluding baseline CRP) the conditional odds ratio for Nafamostat versus standard of care was [median (95% CrI), Pr(OR<1)]`r sprintf("%.2f (%.2f, %.2f), %.2f", median(res$drws$AOR), quantile(res$drws$AOR, 0.025), quantile(res$drws$AOR, 0.975), Pr(res$drws$AOR < 1))`.```{r}#| label: odds-ratio-summary-table-primary-model-fas-itt#| tbl-cap: Posterior summaries for model parameters.save_tex_table(odds_ratio_summary_table(c(res$drws$AOR, res$drws$COR, res$drws$OR[-1]), "latex"),"outcomes/primary/primary-model-fas-itt-summary-table")odds_ratio_summary_table(c(res$drws$AOR, res$drws$COR, res$drws$OR[-1]))``````{r}#| label: tbl-decision-quantities-fas-itt#| tbl-cap: Decision quantity summaries, FAS-ITT.save_tex_table(decision_quantity_summary_table(c("SoC"=rvar(1), res$drws$AOR), format ="latex") |>bind_rows(decision_quantity_summary_table(c("Low-dose"=rvar(1), res$drws$COR), format ="latex")) |>kable("latex", align ="llrrrr", booktabs =TRUE, escape =FALSE) |>kable_styling(latex_options ="HOLD_position", font_size =8) |>pack_rows("Antiviral", 1, 2) |>pack_rows("Anticoagulation", 3, 6),"outcomes/primary/primary-model-fas-itt-decision-table")decision_quantity_summary_table(c("SoC"=rvar(1), res$drws$AOR)) |>bind_rows(decision_quantity_summary_table(c("Low-dose"=rvar(1), res$drws$COR))) |>kable(align ="llrrrr") |>kable_styling("striped", font_size =10) |>pack_rows("Antiviral", 1, 2) |>pack_rows("Anticoagulation", 3, 6)``````{r}#| label: fig-or-densities-fas-itt-model#| fig-cap: Posterior densities for odds ratio contrasts.p <-plot_or_densities(c(res$drws$AOR, res$drws$COR)) +labs(x ="Odds ratio (log scale)", y ="Comparison")pth <-file.path("outputs", "figures", "outcomes", "primary", "primary-model-fas-itt-odds-ratio-densities.pdf")ggsave(pth, p, width =6, height =2.5)p``````{r}#| label: odds-ratio-summary-primary-model-fas-itt-epoch-site-termsp <-plot_epoch_site_terms( res$drws$gamma_epoch, res$drws$gamma_site,factor( res$dat$region_by_site, labels =c("India", "Australia\nNew Zealand", "Nepal")))pth <-file.path("outputs", "figures", "outcomes", "primary", "primary-model-fas-itt-epoch-site-terms.pdf")ggsave(pth, p, width =6, height =4.5)p```:::{.callout-caution collapse="true"}#### Diagnostics```{r}res$fit$summary(c("beta", "gamma_epoch", "tau_epoch", "gamma_site", "tau_site"))res$fit$diagnostic_summary()```::::::{.callout-caution collapse="true"}#### Trace plots```{r}mcmc_trace(res$drws["beta"])mcmc_trace(res$drws["gamma_epoch"])mcmc_trace(res$drws["tau_epoch"])mcmc_trace(res$drws["gamma_site"])mcmc_trace(res$drws["tau_site"])```:::#### Posterior Predictive Checks```{r}#| label: primary-fas-itt-ppcy_ppc <- res$drws$y_ppcppc_dat <-bind_cols(fas_itt_nona_dat, tibble(y_ppc = y_ppc))grp_ppc <-function(grp) { ppc_dat %>%group_by(grp =!!grp) %>%summarise(mean_y =mean(PO),rvar_mean_y_ppc =rvar_mean(y_ppc) )}grp2_ppc <-function(grp1, grp2) { ppc_dat %>%group_by(grp1 =!!grp1, grp2 =!!grp2) %>%summarise(mean_y =mean(PO),rvar_mean_y_ppc =rvar_mean(y_ppc) )}plot_grp_ppc <-function(dat, lab ="") { dat %>%ggplot(aes(y = grp, xdist = rvar_mean_y_ppc)) +stat_interval(size =2) +geom_point(aes(x = mean_y, y =1:nrow(dat)), colour ="red", shape =23) +labs(x ="Posterior predictive\nproportion", y = lab) }ppc_A <-grp_ppc(sym("AAssignment"))ppc_C <-grp_ppc(sym("CAssignment"))ppc_ctry <-grp_ppc(sym("Country"))ppc_epoch <-grp_ppc(sym("epoch"))ppc_site <- ppc_dat %>%group_by(Country = Country, grp = site) %>%summarise(mean_y =mean(PO),rvar_mean_y_ppc =rvar_mean(y_ppc) )p0 <-plot_grp_ppc(ppc_A, "Anti-\nviral") +labs(x ="")p1 <-plot_grp_ppc(ppc_C, "Anti-\ncoagulation") +labs(x ="")p2 <-plot_grp_ppc(ppc_ctry, "Country") +labs(x ="")p3 <-plot_grp_ppc(ppc_epoch, "Epoch") +labs(x ="")p4 <-plot_grp_ppc(ppc_site %>%filter(Country =="IN"), "Sites\nIndia") +labs(x ="")p5 <-plot_grp_ppc(ppc_site %>%filter(Country =="AU"), "Sites\nAustralia") +labs(x ="")p6 <-plot_grp_ppc(ppc_site %>%filter(Country =="NP"), "Sites\nNepal")p7 <-plot_grp_ppc(ppc_site %>%filter(Country =="NZ"), "Sites\nNZ")p <- ((p3 | (p0 | p1) / p2) / ( (p4 | p5) / (p6 | p7) +plot_layout(heights =c(3, 1)) ) ) +plot_layout(heights =c(1, 1.5), guides ="collect") &theme(legend.position ="bottom")pth <-file.path("outputs", "figures", "outcomes", "primary","primary-model-fas-itt-ppc.pdf")ggsave(pth, p, width =6, height =5.5)p```### Treatment onlyIn this model, we investigate Nafamostat as the only fixed covariate, but still include site (not nested within region) and epoch as random effects.```{r}res <-fit_primary_model( fas_itt_nona_dat, logistic_site_epoch, ctr = contr.equalprior,vars =NULL,beta_sd_var =NULL,)names(res$drws$AOR) <-"Nafamostat"names(res$drws$COR) <-intervention_labels2()$CAssignment[-(1:2)]``````{r}#| label: odds-ratio-summary-table-primary-model-fas-itt-trt-only#| tbl-cap: Posterior summaries for model parameters.odds_ratio_summary_table(c(res$drws$AOR, res$drws$COR))``````{r}#| label: odds-ratio-summary-primary-model-fas-itt-trt-only-epoch-site-termsp <-plot_epoch_site_terms( res$drws$gamma_epoch, res$drws$gamma_site,factor( res$dat$region_by_site, labels =c("India", "Australia\nNew Zealand", "Nepal")))p```### Treatment coding priorThe primary model is re-fit assuming a prior specified on the treatment indicator variables rather than on the orthonormal terms. Note that the prior scales need to be adjusted. The prior $\text{Normal}(0,1)$ on the orthonormal terms imply $\text{Normal}(0,2)$ on the pair-wise differences. Therefore, for the treatment coding we specify a prior standard deviation of $\sqrt{2}$ instead of 1.```{r}# res <- fit_primary_model(fas_itt_nona_dat, logistic_site_epoch, ctr = contr.treatment, beta_sd_trt = sqrt(2))mdat <-make_primary_model_data( fas_itt_nona_dat, ctr = contr.treatment, vars =c("inelgc3", "agegte60", "sexF", "supp_oxy2", "ctry"), beta_sd_var =c(10, 2.5, 2.5, 2.5, 1, 1),beta_sd_trt =sqrt(2))snk <-capture.output(mfit <- logistic_site_epoch[["sample"]](data = mdat, seed =32915, adapt_delta =0.99, refresh =0, iter_warmup =1000, iter_sampling =2500, chains =8, parallel_chains =min(8, parallel::detectCores())))mpars <- mfit$metadata()$model_paramskeep <- mpars[!grepl("(_raw|epsilon_)", mpars)]mdrws <-as_draws_rvars(mfit$draws(keep))names(mdrws$beta) <-colnames(mdat$X)site_var <-"site_num"if (any(grepl("site", keep))) {if (site_var =="site2_num") { site_map <- fas_itt_nona_dat %>% dplyr::count(.data[[site_var]], site2)names(mdrws$gamma_site) <- site_map$site2 }else { site_map <- fas_itt_nona_dat %>% dplyr::count(.data[[site_var]], site)names(mdrws$gamma_site) <- site_map$site } }if (any(grepl("epoch", keep))) { epoch_map <- fas_itt_nona_dat %>% dplyr::count(epoch, epoch_lab)names(mdrws$gamma_epoch) <- epoch_map$epoch_lab }Ca <- mdat$ctrAmdrws$Acon <-as.vector(Ca %**% mdrws$beta[grepl("randAA[0-9]", names(mdrws$beta))])names(mdrws$Acon) <-rownames(Ca)mdrws$Atrt <- mdrws$Acon[-1] - mdrws$Acon[1]mdrws$AOR <-exp(mdrws$Atrt)Cc <- mdat$ctrCmdrws$Ccon <-as.vector(Cc %**% mdrws$beta[grepl("randCC[0-9]", names(mdrws$beta))])names(mdrws$Ccon) <-rownames(Cc)mdrws$Ctrt <- mdrws$Ccon[-1] - mdrws$Ccon[1]mdrws$COR <-exp(mdrws$Ctrt)mdrws$OR <-exp(mdrws$beta[!grepl("(Intercept|rand)", names(mdrws$beta))])names(mdrws$AOR) <-"Nafamostat"names(mdrws$COR) <-intervention_labels2()$CAssignment[-(1:2)]names(mdrws$OR)[-1] <-c("Ineligible aspirin", "Age \u2265 60", "Female", "Oxygen requirement", "Australia/New Zealand", "Nepal")``````{r}#| label: odds-ratio-summary-table-primary-model-fas-itt-trt#| tbl-cap: Posterior summaries for model parameters.odds_ratio_summary_table(c(mdrws$AOR, mdrws$COR, mdrws$OR[-1]))``````{r}#| label: odds-ratio-summary-primary-model-fas-itt-epoch-site-terms-trtp <-plot_epoch_site_terms( mdrws$gamma_epoch, mdrws$gamma_site,factor( mdat$region_by_site, labels =c("India", "Australia\nNew Zealand", "Nepal")))p```### Diffuse priorFor all fixed model parameters (including treatment differences), assume $\text{Normal}(0, 10^2)$.```{r}res <-fit_primary_model( fas_itt_nona_dat, logistic_site_epoch, ctr = contr.equalprior_deviations, beta_sd_int =10, beta_sd_trt =10, beta_sd_var =rep(10, 6))names(res$drws$AOR) <-"Nafamostat"names(res$drws$COR) <-intervention_labels2()$CAssignment[-(1:2)]names(res$drws$OR)[-1] <-c("Ineligible aspirin", "Age \u2265 60", "Female", "Oxygen requirement", "Australia/New Zealand", "Nepal")``````{r}#| label: odds-ratio-summary-table-primary-model-fas-itt-diffuse#| tbl-cap: Posterior summaries for model parameters.odds_ratio_summary_table(c(res$drws$AOR, res$drws$COR, res$drws$OR[-1]))``````{r}#| label: odds-ratio-summary-primary-model-fas-itt-epoch-site-terms-diffusep <-plot_epoch_site_terms( res$drws$gamma_epoch, res$drws$gamma_site,factor( res$dat$region_by_site, labels =c("India", "Australia\nNew Zealand", "Nepal")))p```### Sceptical priorFor treatment differences, assume $\text{Normal}(0, 0.4^2)$```{r}res <-fit_primary_model( fas_itt_nona_dat, logistic_site_epoch, ctr = contr.equalprior_pairs, beta_sd_trt =0.4)names(res$drws$AOR) <-"Nafamostat"names(res$drws$COR) <-intervention_labels2()$CAssignment[-(1:2)]names(res$drws$OR)[-1] <-c("Ineligible aspirin", "Age \u2265 60", "Female", "Oxygen requirement", "Australia/New Zealand", "Nepal")``````{r}#| label: odds-ratio-summary-table-primary-model-fas-itt-sceptical#| tbl-cap: Posterior summaries for model parameters.odds_ratio_summary_table(c(res$drws$AOR, res$drws$COR, res$drws$OR[-1]))``````{r}#| label: odds-ratio-summary-primary-model-fas-itt-epoch-site-terms-scepticalp <-plot_epoch_site_terms( res$drws$gamma_epoch, res$drws$gamma_site,factor( res$dat$region_by_site, labels =c("India", "Australia\nNew Zealand", "Nepal")))p```### Best Case```{r}res <-fit_primary_model(fas_itt_bc_dat, logistic_site_epoch, ctr = contr.equalprior)names(res$drws$AOR) <-"Nafamostat"names(res$drws$COR) <-intervention_labels2()$CAssignment[-(1:2)]names(res$drws$OR)[-1] <-c("Ineligible aspirin", "Age \u2265 60", "Female", "Oxygen requirement", "Australia/New Zealand", "Nepal")``````{r}#| label: odds-ratio-summary-table-primary-model-fas-itt-best-case#| tbl-cap: Posterior summaries for model parameters.save_tex_table(odds_ratio_summary_table(c(res$drws$AOR, res$drws$COR, res$drws$OR[-1]), "latex"),"outcomes/primary/primary-model-fas-itt-best-case-summary-table")odds_ratio_summary_table(c(res$drws$AOR, res$drws$COR, res$drws$OR[-1]))``````{r}#| label: fig-or-densities-fas-itt-best-case-model#| fig-cap: Posterior densities for odds ratio contrasts.p <-plot_or_densities(c(res$drws$AOR, res$drws$COR)) +labs(x ="Odds ratio (log scale)", y ="Comparison")pth <-file.path("outputs", "figures", "outcomes", "primary", "primary-model-fas-itt-best-case-odds-ratio-densities.pdf")ggsave(pth, p, width =6, height =2.5)p``````{r}#| label: odds-ratio-summary-primary-model-fas-itt-best-case-epoch-site-termsp <-plot_epoch_site_terms( res$drws$gamma_epoch, res$drws$gamma_site,factor( res$dat$region_by_site, labels =c("India", "Australia\nNew Zealand", "Nepal")))pth <-file.path("outputs", "figures", "outcomes", "primary", "primary-model-fas-itt-best-case-epoch-site-terms.pdf")ggsave(pth, p, width =6, height =4.5)p```### Worst Case```{r}res <-fit_primary_model(fas_itt_wc_dat, logistic_site_epoch, ctr = contr.equalprior)names(res$drws$AOR) <-"Nafamostat"names(res$drws$COR) <-intervention_labels2()$CAssignment[-(1:2)]names(res$drws$OR)[-1] <-c("Ineligible aspirin", "Age \u2265 60", "Female", "Oxygen requirement", "Australia/New Zealand", "Nepal")``````{r}#| label: odds-ratio-summary-table-primary-model-fas-itt-worst-case#| tbl-cap: Posterior summaries for model parameters.save_tex_table(odds_ratio_summary_table(c(res$drws$AOR, res$drws$COR, res$drws$OR[-1]), "latex"),"outcomes/primary/primary-model-fas-itt-worst-case-summary-table")odds_ratio_summary_table(c(res$drws$AOR, res$drws$COR, res$drws$OR[-1]))``````{r}#| label: fig-or-densities-fas-itt-worst-case-model#| fig-cap: Posterior densities for odds ratio contrasts.p <-plot_or_densities(c(res$drws$AOR, res$drws$COR)) +labs(x ="Odds ratio (log scale)", y ="Comparison")pth <-file.path("outputs", "figures", "outcomes", "primary", "primary-model-fas-itt-worst-case-odds-ratio-densities.pdf")ggsave(pth, p, width =6, height =2.5)p``````{r}#| label: odds-ratio-summary-primary-model-fas-itt-worst-case-epoch-site-termsp <-plot_epoch_site_terms( res$drws$gamma_epoch, res$drws$gamma_site,factor( res$dat$region_by_site, labels =c("India", "Australia\nNew Zealand", "Nepal")))pth <-file.path("outputs", "figures", "outcomes", "primary", "primary-model-fas-itt-worst-case-epoch-site-terms.pdf")ggsave(pth, p, width =6, height =4.5)p```### Australia/New Zealand Only- dropped region covariate- dropped ineligibility for aspirin covariate (4 cases)```{r}res <-fit_primary_model( fas_itt_aunz_nona_dat, logistic_site_epoch, vars =c("agegte60", "sexF", "supp_oxy2"),beta_sd_var =c(2.5, 2.5, 2.5),ctr = contr.equalprior)names(res$drws$AOR) <-"Nafamostat"names(res$drws$COR) <-intervention_labels2()$CAssignment[-(1:2)]names(res$drws$OR)[-1] <-c("Age \u2265 60", "Female", "Oxygen requirement")``````{r}#| label: odds-ratio-summary-table-primary-model-fas-itt-aunz#| tbl-cap: Posterior summaries for model parameters.save_tex_table(odds_ratio_summary_table(c(res$drws$AOR, res$drws$COR, res$drws$OR[-1]), "latex"),"outcomes/primary/primary-model-fas-itt-aunz-summary-table")odds_ratio_summary_table(c(res$drws$AOR, res$drws$COR, res$drws$OR[-1]))``````{r}#| label: fig-or-densities-fas-itt-aunz-model#| fig-cap: Posterior densities for odds ratio contrasts.p <-plot_or_densities(c(res$drws$AOR, res$drws$COR)) +labs(x ="Odds ratio (log scale)", y ="Comparison")pth <-file.path("outputs", "figures", "outcomes", "primary", "primary-model-fas-itt-aunz-odds-ratio-densities.pdf")ggsave(pth, p, width =6, height =2.5)system(sprintf("pdftoppm %s %s -png", pth, gsub(".pdf", "", pth)))p``````{r}#| label: odds-ratio-summary-primary-model-fas-itt-aunz-epoch-site-termsp <-plot_epoch_site_terms( res$drws$gamma_epoch, res$drws$gamma_site,factor( res$dat$region_by_site, labels =c("Australia\nNew Zealand")))pth <-file.path("outputs", "figures", "outcomes", "primary", "primary-model-fas-itt-aunz-epoch-site-terms.pdf")ggsave(pth, p, width =6, height =4.5)p```### Country instead of region```{r}res <-fit_primary_model( fas_itt_nona_dat, logistic_site_epoch, vars =c("inelgc3", "agegte60", "sexF", "supp_oxy2", "ctry2"),beta_sd_var =c(10, 2.5, 2.5, 2.5, 1, 1, 1),ctry_var ="ctry2_num",site_var ="site2_num",ctr = contr.equalprior)names(res$drws$AOR) <-"Nafamostat"names(res$drws$COR) <-intervention_labels2()$CAssignment[-(1:2)]names(res$drws$OR)[-1] <-c("Ineligible aspirin", "Age \u2265 60", "Female", "Oxygen requirement", "Australia", "Nepal", "New Zealand")``````{r}#| label: odds-ratio-summary-table-primary-model-fas-itt-country3#| tbl-cap: Posterior summaries for model parameters.odds_ratio_summary_table(c(res$drws$AOR, res$drws$COR, res$drws$OR[-1]))``````{r}#| label: tbl-decision-quantities-fas-itt-country2#| tbl-cap: Decision quantity summaries, FAS-ITT.decision_quantity_summary_table(c("SoC"=rvar(1), res$drws$AOR)) |>bind_rows(decision_quantity_summary_table(c("Low-dose"=rvar(1), res$drws$COR))) |>kable(align ="llrrrr") |>kable_styling("striped", font_size =10) |>pack_rows("Antiviral", 1, 2) |>pack_rows("Anticoagulation", 3, 6)``````{r}#| label: fig-or-densities-fas-itt-model-country2#| fig-cap: Posterior densities for odds ratio contrasts.p <-plot_or_densities(c(res$drws$AOR, res$drws$COR)) +labs(x ="Odds ratio (log scale)", y ="Comparison")p``````{r}#| label: odds-ratio-summary-primary-model-fas-itt-epoch-site-terms-country2p <-plot_epoch_site_terms( res$drws$gamma_epoch, res$drws$gamma_site,factor( res$dat$region_by_site, labels =c("India", "Australia", "Nepal", "New Zealand")))p```## ACS-ITT### Pre-specified```{r}res <-fit_primary_model(acs_itt_nona_dat, logistic_site_epoch, ctr = contr.equalprior)names(res$drws$AOR) <-"Nafamostat"names(res$drws$COR) <-intervention_labels2()$CAssignment[-(1:2)]names(res$drws$OR)[-1] <-c("Ineligible aspirin", "Age \u2265 60", "Female", "Oxygen requirement", "Australia/New Zealand", "Nepal")``````{r}#| label: odds-ratio-summary-table-primary-model-acs-itt#| tbl-cap: Posterior summaries for model parameters.save_tex_table(odds_ratio_summary_table(c(res$drws$AOR, res$drws$COR, res$drws$OR[-1]), "latex"),"outcomes/primary/primary-model-acs-itt-summary-table")odds_ratio_summary_table(c(res$drws$AOR, res$drws$COR, res$drws$OR[-1]))``````{r}#| label: tbl-decision-quantities-acs-itt#| tbl-cap: Decision quantity summaries, ACS-ITT.save_tex_table(decision_quantity_summary_table(c("SoC"=rvar(1), res$drws$AOR), format ="latex") |>bind_rows(decision_quantity_summary_table(c("Low-dose"=rvar(1), res$drws$COR), format ="latex")) |>kable("latex", align ="llrrrr", booktabs =TRUE, escape =FALSE) |>kable_styling(latex_options ="HOLD_position", font_size =8) |>pack_rows("Antiviral", 1, 2) |>pack_rows("Anticoagulation", 3, 6),"outcomes/primary/primary-model-acs-itt-decision-table")decision_quantity_summary_table(c("SoC"=rvar(1), res$drws$AOR)) |>bind_rows(decision_quantity_summary_table(c("Low-dose"=rvar(1), res$drws$COR))) |>kable(align ="llrrrr") |>kable_styling("striped", font_size =12) |>pack_rows("Antiviral", 1, 2) |>pack_rows("Anticoagulation", 3, 6)``````{r}#| label: fig-or-densities-acs-itt-model#| fig-cap: Posterior densities for odds ratio contrasts.p <-plot_or_densities(c(res$drws$AOR, res$drws$COR)) +labs(x ="Odds ratio (log scale)", y ="Comparison")pth <-file.path("outputs", "figures", "outcomes", "primary", "primary-model-acs-itt-odds-ratio-densities.pdf")ggsave(pth, p, width =6, height =2.5)p``````{r}#| label: odds-ratio-summary-primary-model-acs-itt-epoch-site-termsp <-plot_epoch_site_terms( res$drws$gamma_epoch, res$drws$gamma_site,factor( res$dat$region_by_site, labels =c("India", "Australia\nNew Zealand", "Nepal")))pth <-file.path("outputs", "figures", "outcomes", "primary", "primary-model-acs-itt-epoch-site-terms.pdf")ggsave(pth, p, width =6, height =4.5)p```<!-- ### Treatment coding prior```{r}#| eval: falseres <- fit_primary_model( acs_itt_nona_dat, logistic_site_epoch, ctr = contr.treatment, beta_sd_trt = sqrt(2))names(res$drws$AOR) <- "Nafamostat"names(res$drws$COR) <- intervention_labels2()$CAssignment[-(1:2)]names(res$drws$OR)[-1] <- c("Ineligible aspirin", "Age \u2265 60", "Female", "Oxygen requirement", "Australia/New Zealand", "Nepal")``````{r}#| label: odds-ratio-summary-table-primary-model-acs-itt-trt#| tbl-cap: Posterior summaries for model parameters.odds_ratio_summary_table(c(res$drws$AOR, res$drws$COR, res$drws$OR[-1]))``````{r}#| label: odds-ratio-summary-primary-model-acs-itt-epoch-site-terms-trtp <- plot_epoch_site_terms( res$drws$gamma_epoch, res$drws$gamma_site, factor( res$dat$region_by_site, labels = c("India", "Australia\nNew Zealand", "Nepal")))p``` -->### Diffuse```{r}res <-fit_primary_model( fas_itt_nona_dat, logistic_site_epoch, ctr = contr.equalprior_deviations, beta_sd_int =10, beta_sd_trt =10, beta_sd_var =rep(10, 6))names(res$drws$AOR) <-"Nafamostat"names(res$drws$COR) <-intervention_labels2()$CAssignment[-(1:2)]names(res$drws$OR)[-1] <-c("Ineligible aspirin", "Age \u2265 60", "Female", "Oxygen requirement", "Australia/New Zealand", "Nepal")``````{r}#| label: odds-ratio-summary-table-primary-model-acs-itt-diffuse#| tbl-cap: Posterior summaries for model parameters.odds_ratio_summary_table(c(res$drws$AOR, res$drws$COR, res$drws$OR[-1]))``````{r}#| label: odds-ratio-summary-primary-model-acs-itt-epoch-site-terms-diffusep <-plot_epoch_site_terms( res$drws$gamma_epoch, res$drws$gamma_site,factor( res$dat$region_by_site, labels =c("India", "Australia\nNew Zealand", "Nepal")))p```## AVS-ITT### Treatment OnlyThe SAP suggests that the primary analysis be based on the AVS-ITT set, but that adjustment should still be made for all the covariates.This is somewhat problematic as there is no longer sufficient data to inform all of the covariates (e.g. little information available on the effect of anticoagulation interventions, country, age etc.).The following analysis is restricted to the AVS-ITT set but restricts the analysis to a reduced set:- antiviral intervention- anticoagulation intervention- age group- oxygen requirement```{r}res <-fit_primary_model( avs_itt_nona_dat, logistic_mod,vars =NULL,beta_sd_var =NULL,includeC =FALSE)names(res$drws$AOR) <-"Nafamostat"``````{r}#| label: odds-ratio-summary-table-primary-model-avs-itt-trt-only#| tbl-cap: Posterior summaries for model parameters.save_tex_table(odds_ratio_summary_table(c(res$drws$AOR), "latex"),"outcomes/primary/primary-model-avs-itt-summary-table-trt-only")odds_ratio_summary_table(res$drws$AOR)``````{r}#| label: fig-or-densities-avs-itt-model-trt-only#| fig-cap: Posterior densities for odds ratio contrasts.p <-plot_or_densities(c(res$drws$AOR, res$drws$COR)) +labs(x ="Odds ratio (log scale)", y ="Comparison")pth <-file.path("outputs", "figures", "outcomes", "primary", "primary-model-avs-itt-odds-ratio-densities-trt-only.pdf")ggsave(pth, p, width =6, height =2.5)p```### Pre-specified - without siteIn this section the pre-specified model with covariates is fit.However, again with no region, epoch or site specific terms.```{r}res <-fit_primary_model( avs_itt_nona_dat, logistic_mod,vars =c("agegte60", "sexF", "supp_oxy2", "crp_tertile"),beta_sd_var =c(2.5, 2.5, 2.5, 2.5, 2.5, 2.5))names(res$drws$AOR) <-"Nafamostat"names(res$drws$COR) <-intervention_labels2()$CAssignment[-(1:2)]names(res$drws$OR)[-1] <-c("Age \u2265 60", "Female", "Required oxygen", "CRP (2nd tertile)", "CRP (3rd tertile)", "CRP (unknown)")``````{r}#| label: odds-ratio-summary-table-primary-model-avs-itt#| tbl-cap: Posterior summaries for model parameters.save_tex_table(odds_ratio_summary_table(c(res$drws$AOR, res$drws$COR, res$drws$OR[-1]), "latex"),"outcomes/primary/primary-model-avs-itt-summary-table")odds_ratio_summary_table(c(res$drws$AOR, res$drws$COR, res$drws$OR[-1]))``````{r}#| label: tbl-decision-quantities-avs-itt#| tbl-cap: Decision quantity summaries, AVS-ITT.save_tex_table(decision_quantity_summary_table(c("SoC"=rvar(1), res$drws$AOR), format ="latex") |># bind_rows(decision_quantity_summary_table(c("Low-dose" = rvar(1), res$drws$COR), format = "latex")) |>kable("latex", align ="llrrrr", booktabs =TRUE, escape =FALSE) |>kable_styling(latex_options ="HOLD_position", font_size =8) |>pack_rows("Antiviral", 1, 2),# pack_rows("Anticoagulation", 3, 6),"outcomes/primary/primary-model-avs-itt-decision-table")decision_quantity_summary_table(c("SoC"=rvar(1), res$drws$AOR)) |># bind_rows(decision_quantity_summary_table(c("Low-dose" = rvar(1), res$drws$COR))) |>kable(align ="llrrrr") |>kable_styling("striped", font_size =12) |>pack_rows("Antiviral", 1, 2)# pack_rows("Anticoagulation", 3, 6)``````{r}#| label: fig-or-densities-avs-itt-model#| fig-cap: Posterior densities for odds ratio contrasts.p <-plot_or_densities(c(res$drws$AOR)) +labs(x ="Odds ratio (log scale)", y ="Comparison")pth <-file.path("outputs", "figures", "outcomes", "primary", "primary-model-avs-itt-odds-ratio-densities.pdf")ggsave(pth, p, width =6, height =2.5)p```### Pre-specified - with siteIn this section the pre-specified model with covariates is fit.Again with no epoch terms, but we do include region and site.```{r}res <-fit_primary_model( avs_itt_nona_dat |>mutate(ctry =droplevels(ctry)), logistic_site,vars =c("agegte60", "sexF", "supp_oxy2", "crp_tertile", "ctry"),beta_sd_var =c(2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 1))names(res$drws$AOR) <-"Nafamostat"names(res$drws$COR) <-intervention_labels2()$CAssignment[-(1:2)]names(res$drws$OR)[-1] <-c("Age \u2265 60", "Female", "Required oxygen", "CRP (2nd tertile)", "CRP (3rd tertile)", "CRP (unknown)", "Nepal")``````{r}#| label: odds-ratio-summary-table-primary-model-avs-itt-with-site#| tbl-cap: Posterior summaries for model parameters.save_tex_table(odds_ratio_summary_table(c(res$drws$AOR, res$drws$COR, res$drws$OR[-1]), "latex"),"outcomes/primary/primary-model-avs-itt-with-site-summary-table")odds_ratio_summary_table(c(res$drws$AOR, res$drws$COR, res$drws$OR[-1]))``````{r}#| label: tbl-decision-quantities-avs-itt-wth-site#| tbl-cap: Decision quantity summaries, AVS-ITT.save_tex_table(decision_quantity_summary_table(c("SoC"=rvar(1), res$drws$AOR), format ="latex") |># bind_rows(decision_quantity_summary_table(c("Low-dose" = rvar(1), res$drws$COR), format = "latex")) |>kable("latex", align ="llrrrr", booktabs =TRUE, escape =FALSE) |>kable_styling(latex_options ="HOLD_position", font_size =8) |>pack_rows("Antiviral", 1, 2),# pack_rows("Anticoagulation", 3, 6),"outcomes/primary/primary-model-avs-itt-with-site-decision-table")decision_quantity_summary_table(c("SoC"=rvar(1), res$drws$AOR)) |># bind_rows(decision_quantity_summary_table(c("Low-dose" = rvar(1), res$drws$COR))) |>kable(align ="llrrrr") |>kable_styling("striped", font_size =12) |>pack_rows("Antiviral", 1, 2)# pack_rows("Anticoagulation", 3, 6)``````{r}#| label: fig-or-densities-avs-itt-model-wth-site#| fig-cap: Posterior densities for odds ratio contrasts.p <-plot_or_densities(c(res$drws$AOR)) +labs(x ="Odds ratio (log scale)", y ="Comparison")pth <-file.path("outputs", "figures", "outcomes", "primary", "primary-model-avs-itt-with-site-odds-ratio-densities.pdf")ggsave(pth, p, width =6, height =2.5)p``````{r}#| label: odds-ratio-summary-primary-model-avs-itt-epoch-site-terms-with-sitep <-plot_site_terms( res$drws$gamma_site,factor( res$dat$region_by_site, labels =c("Australia\nNew Zealand", "Nepal")))pth <-file.path("outputs", "figures", "outcomes", "primary", "primary-model-avs-itt-epoch-site-terms-with-site.pdf")ggsave(pth, p, width =6, height =4.5)p```### Treatment coding```{r}#| eval: falseres <-fit_primary_model( avs_itt_nona_dat, logistic_mod,vars =c("agegte60", "sexF", "supp_oxy2", "crp_tertile"),ctr = contr.treatment,beta_sd_trt =sqrt(2),beta_sd_var =c(2.5, 2.5, 2.5, 2.5, 2.5, 2.5),includeC =TRUE)names(res$drws$AOR) <-"Nafamostat"names(res$drws$OR)[-1] <-c("Age \u2265 60", "Female", "Required oxygen", "CRP (2nd tertile)", "CRP (3rd tertile)", "CRP (unknown)")``````{r}#| label: odds-ratio-summary-table-primary-model-avs-itt-trt#| tbl-cap: Posterior summaries for model parameters, AVS-ITT, prior on treatment coding.#| eval: falseodds_ratio_summary_table(c(res$drws$AOR, res$drws$OR[-1]))```### Diffuse prior```{r}res <-fit_primary_model( avs_itt_nona_dat, logistic_mod,vars =c("agegte60", "sexF", "supp_oxy2", "crp_tertile"),beta_sd_int =10,beta_sd_trt =10,beta_sd_var =c(10, 10, 10, 10, 10, 10),includeC =FALSE)names(res$drws$AOR) <-"Nafamostat"names(res$drws$OR)[-1] <-c("Age \u2265 60", "Female", "Required oxygen", "CRP (2nd tertile)", "CRP (3rd tertile)", "CRP (unknown)")``````{r}#| label: odds-ratio-summary-table-primary-model-avs-itt-diffuse#| tbl-cap: Posterior summaries for model parameters, AVS-ITT.odds_ratio_summary_table(c(res$drws$AOR, res$drws$OR[-1]))```### Sceptical prior```{r}res <-fit_primary_model( avs_itt_nona_dat, logistic_mod,vars =c("agegte60", "sexF", "supp_oxy2", "crp_tertile"),beta_sd_int =2.5,beta_sd_trt =0.4,beta_sd_var =c(2.5, 2.5, 2.5, 2.5, 2.5, 2.5),includeC =FALSE)names(res$drws$AOR) <-"Nafamostat"names(res$drws$OR)[-1] <-c("Age \u2265 60", "Female", "Required oxygen", "CRP (2nd tertile)", "CRP (3rd tertile)", "CRP (unknown)")``````{r}#| label: odds-ratio-summary-table-primary-model-avs-itt-sceptical#| tbl-cap: Posterior summaries for model parameters, AVS-ITT.odds_ratio_summary_table(c(res$drws$AOR, res$drws$OR[-1]))```## FAS-PPHere the primary model is fit to the FAS-PP where per-protocol participants were identified as per the provided listings. Participants may be excluded due to failing the per-protocol criteria for the anticoagulation domain or the antiviral domain (or both).```{r}#| label: tbl-domainC-po-fas-pp#| code-summary: Relationship anti-coagulation to outcome#| tbl-cap: Primary outcome by anti-coagulation intervention.make_po_table_C(fas_pp_dat)save_tex_table(make_po_table_C( fas_pp_dat,"latex"), "outcomes/primary/anticoagulation-summary-fas-pp")``````{r}#| label: tbl-domainA-po-fas-pp#| code-summary: Relationship anti-viral to outcome#| tbl-cap: Primary outcome by anti-viral intervention.make_po_table_A(fas_pp_dat)save_tex_table(make_po_table_A( fas_pp_dat,"latex"), "outcomes/primary/antiviral-summary-fas-pp")``````{r}res <-fit_primary_model(fas_pp_nona_dat, logistic_site_epoch, ctr = contr.equalprior)names(res$drws$AOR) <-"Nafamostat"names(res$drws$COR) <-intervention_labels2()$CAssignment[-(1:2)]names(res$drws$OR)[-1] <-c("Ineligible aspirin", "Age \u2265 60", "Female", "Oxygen requirement", "Australia/New Zealand", "Nepal")``````{r}#| label: odds-ratio-summary-table-primary-model-fas-pp#| tbl-cap: Posterior summaries for model parameters.save_tex_table(odds_ratio_summary_table(c(res$drws$AOR, res$drws$COR, res$drws$OR[-1]), "latex"),"outcomes/primary/primary-model-fas-pp-summary-table")odds_ratio_summary_table(c(res$drws$AOR, res$drws$COR, res$drws$OR[-1]))``````{r}#| label: fig-or-densities-fas-pp-model#| fig-cap: Posterior densities for odds ratio contrasts.p <-plot_or_densities(c(res$drws$AOR, res$drws$COR)) +labs(x ="Odds ratio (log scale)", y ="Comparison")pth <-file.path("outputs", "figures", "outcomes", "primary", "primary-model-fas-pp-odds-ratio-densities.pdf")ggsave(pth, p, width =6, height =2.5)p``````{r}#| label: odds-ratio-summary-primary-model-fas-pp-epoch-site-termsp <-plot_epoch_site_terms( res$drws$gamma_epoch, res$drws$gamma_site,factor( res$dat$region_by_site, labels =c("India", "Australia\nNew Zealand", "Nepal")))pth <-file.path("outputs", "figures", "outcomes", "primary", "primary-model-fas-pp-epoch-site-terms.pdf")ggsave(pth, p, width =6, height =4.5)p```## ACS-PPNote that for ACS-PP only participants who were not per-protocol according to the anticoagulation domain are excluded. A participant who was not per-protocol according to the antiviral domain but was per-protocol according to the anticoagulation domain is kept in the analysis set. The alternative would be to exclude both (as for FAS-PP).```{r}res <-fit_primary_model(acs_pp_nona_dat, logistic_site_epoch, ctr = contr.equalprior)names(res$drws$AOR) <-"Nafamostat"names(res$drws$COR) <-intervention_labels2()$CAssignment[-(1:2)]names(res$drws$OR)[-1] <-c("Ineligible aspirin", "Age \u2265 60", "Female", "Oxygen requirement", "Australia/New Zealand", "Nepal")``````{r}#| label: odds-ratio-summary-table-primary-model-acs-pp#| tbl-cap: Posterior summaries for model parameters.save_tex_table(odds_ratio_summary_table(c(res$drws$AOR, res$drws$COR, res$drws$OR[-1]), "latex"),"outcomes/primary/primary-model-acs-pp-summary-table")odds_ratio_summary_table(c(res$drws$AOR, res$drws$COR, res$drws$OR[-1]))``````{r}#| label: fig-or-densities-acs-pp-model#| fig-cap: Posterior densities for odds ratio contrasts.p <-plot_or_densities(c(res$drws$AOR, res$drws$COR)) +labs(x ="Odds ratio (log scale)", y ="Comparison")pth <-file.path("outputs", "figures", "outcomes", "primary", "primary-model-acs-pp-odds-ratio-densities.pdf")ggsave(pth, p, width =6, height =2.5)p``````{r}#| label: odds-ratio-summary-primary-model-acs-pp-epoch-site-termsp <-plot_epoch_site_terms( res$drws$gamma_epoch, res$drws$gamma_site,factor( res$dat$region_by_site, labels =c("India", "Australia\nNew Zealand", "Nepal")))pth <-file.path("outputs", "figures", "outcomes", "primary", "primary-model-acs-pp-epoch-site-terms.pdf")ggsave(pth, p, width =6, height =4.5)p```## AVS-PPNote that for AVS-PP only participants who were not per-protocol according to the antiviral domain are excluded. A participant was not per-protocol according to the anticoagulation domain but was per-protocol according to the antiviral domain is kept in the analysis set. The alternative would be to exclude both (as for FAS-PP).```{r}#| label: tbl-domainC-po-avs-pp#| code-summary: Relationship anti-coagulation to outcome#| tbl-cap: Primary outcome by anti-coagulation intervention, AVS-PP.make_po_table_C(avs_pp_dat)save_tex_table(make_po_table_C( avs_pp_dat,"latex"), "outcomes/primary/anticoagulation-summary-avs-pp")``````{r}#| label: tbl-domainA-po-avs-pp#| code-summary: Relationship anti-viral to outcome#| tbl-cap: Primary outcome by anti-viral intervention.make_po_table_A(avs_pp_dat)save_tex_table(make_po_table_A( avs_pp_dat,"latex"), "outcomes/primary/antiviral-summary-avs-pp")```### Pre-specifiedIn this section the pre-specified model with covariates is fit.However, again with no region, epoch or site specific terms.```{r}res <-fit_primary_model( avs_pp_nona_dat |>mutate(ctry =droplevels(ctry)), logistic_site,vars =c("agegte60", "sexF", "supp_oxy2", "crp_tertile", "ctry"),beta_sd_var =c(2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 1))names(res$drws$AOR) <-"Nafamostat"names(res$drws$COR) <-intervention_labels2()$CAssignment[-(1:2)]names(res$drws$OR)[-1] <-c("Age \u2265 60", "Female", "Required oxygen", "CRP (2nd tertile)", "CRP (3rd tertile)", "CRP (unknown)", "Nepal")``````{r}#| label: odds-ratio-summary-table-primary-model-avs-pp#| tbl-cap: Posterior summaries for model parameters.save_tex_table(odds_ratio_summary_table(c(res$drws$AOR, res$drws$COR, res$drws$OR[-1]), "latex"),"outcomes/primary/primary-model-avs-pp-summary-table")odds_ratio_summary_table(c(res$drws$AOR, res$drws$COR, res$drws$OR[-1]))``````{r}#| label: tbl-decision-quantities-avs-pp#| tbl-cap: Decision quantity summaries, AVS-PP.save_tex_table(decision_quantity_summary_table(c("SoC"=rvar(1), res$drws$AOR), format ="latex") |># bind_rows(decision_quantity_summary_table(c("Low-dose" = rvar(1), res$drws$COR), format = "latex")) |>kable("latex", align ="llrrrr", booktabs =TRUE, escape =FALSE) |>kable_styling(latex_options ="HOLD_position", font_size =8) |>pack_rows("Antiviral", 1, 2),# pack_rows("Anticoagulation", 3, 6),"outcomes/primary/primary-model-avs-pp-decision-table")decision_quantity_summary_table(c("SoC"=rvar(1), res$drws$AOR)) |># bind_rows(decision_quantity_summary_table(c("Low-dose" = rvar(1), res$drws$COR))) |>kable(align ="llrrrr") |>kable_styling("striped", font_size =12) |>pack_rows("Antiviral", 1, 2)# pack_rows("Anticoagulation", 3, 6)``````{r}#| label: fig-or-densities-avs-pp-model#| fig-cap: Posterior densities for odds ratio contrasts.p <-plot_or_densities(c(res$drws$AOR)) +labs(x ="Odds ratio (log scale)", y ="Comparison")pth <-file.path("outputs", "figures", "outcomes", "primary", "primary-model-avs-pp-odds-ratio-densities.pdf")ggsave(pth, p, width =6, height =2.5)p```### Treatment Only```{r}res <-fit_primary_model( avs_pp_nona_dat, logistic_mod,vars =NULL,beta_sd_var =NULL,includeC =FALSE)names(res$drws$AOR) <-"Nafamostat"``````{r}#| label: odds-ratio-summary-table-primary-model-avs-pp-trt-only#| tbl-cap: Posterior summaries for model parameters.save_tex_table(odds_ratio_summary_table(c(res$drws$AOR), "latex"),"outcomes/primary/primary-model-avs-pp-summary-table-trt-only")odds_ratio_summary_table(res$drws$AOR)``````{r}#| label: fig-or-densities-avs-pp-model-trt-only#| fig-cap: Posterior densities for odds ratio contrasts.p <-plot_or_densities(c(res$drws$AOR, res$drws$COR)) +labs(x ="Odds ratio (log scale)", y ="Comparison")pth <-file.path("outputs", "figures", "outcomes", "primary", "primary-model-avs-pp-odds-ratio-densities-trt-only.pdf")ggsave(pth, p, width =6, height =2.5)p```### Treatment coding```{r}#| eval: falseres <-fit_primary_model( avs_pp_nona_dat |>mutate(ctry =droplevels(ctry)), logistic_site,vars =c("agegte60", "sexF", "supp_oxy2", "crp_tertile", "ctry"),ctr = contr.treatment,beta_sd_trt =sqrt(2),beta_sd_var =c(2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 1))names(res$drws$AOR) <-"Nafamostat"names(res$drws$COR) <-intervention_labels2()$CAssignment[-(1:2)]names(res$drws$OR)[-1] <-c("Age \u2265 60", "Female", "Required oxygen", "CRP (2nd tertile)", "CRP (3rd tertile)", "CRP (unknown)", "Nepal")``````{r}#| label: odds-ratio-summary-table-primary-model-avs-pp-trt-ctr#| tbl-cap: Posterior summaries for model parameters, AVS-PP, prior on treatment coding.#| eval: falseodds_ratio_summary_table(c(res$drws$AOR, res$drws$COR, res$drws$OR[-1]))```### Sceptical```{r}res <-fit_primary_model( avs_pp_nona_dat |>mutate(ctry =droplevels(ctry)), logistic_site,vars =c("agegte60", "sexF", "supp_oxy2", "crp_tertile", "ctry"),beta_sd_trt =0.4,beta_sd_var =c(2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 1))names(res$drws$AOR) <-"Nafamostat"names(res$drws$COR) <-intervention_labels2()$CAssignment[-(1:2)]names(res$drws$OR)[-1] <-c("Age \u2265 60", "Female", "Required oxygen", "CRP (2nd tertile)", "CRP (3rd tertile)", "CRP (unknown)", "Nepal")``````{r}#| label: odds-ratio-summary-table-primary-model-avs-pp-sceptical#| tbl-cap: Posterior summaries for model parameters.odds_ratio_summary_table(c(res$drws$AOR, res$drws$COR, res$drws$OR[-1]))``````{r}#| label: tbl-decision-quantities-avs-pp-sceptical#| tbl-cap: Decision quantity summaries, AVS-PP.decision_quantity_summary_table(c("SoC"=rvar(1), res$drws$AOR)) |># bind_rows(decision_quantity_summary_table(c("Low-dose" = rvar(1), res$drws$COR))) |>kable(align ="llrrrr") |>kable_styling("striped", font_size =12) |>pack_rows("Antiviral", 1, 2)# pack_rows("Anticoagulation", 3, 6)``````{r}#| label: fig-or-densities-avs-pp-model-sceptical#| fig-cap: Posterior densities for odds ratio contrasts.p <-plot_or_densities(c(res$drws$AOR)) +labs(x ="Odds ratio (log scale)", y ="Comparison")p```## Concurrent```{r}#| label: tbl-acs-itt-c4-summary-table#| tbl-cap: Primary outcome summary for participants randomised under protocol 5.0 (ACS-ITT-therapeutic).#| eval: falsemake_po_table_C(acs_itt_concurc4_dat)make_D28_death_table_C(acs_itt_concurc4_dat)```